Container support for Sitecore Forms Extensions

With the release of Sitecore 10, official support for developing with docker containers was added. In this article we’ll explain how you can add the Sitecore Forms Extensions (SFE) module into your containered Sitecore application.

Before you begin

This article assumes that you have basic knowledge of running Sitecore in containers. Please have a look at the official Sitecore documentation to familiarize yourself with containered development. https://containers.doc.sitecore.com/docs/intro

At the time of writing SFE for containers is only compatible with XP installations (XP0 + XP1).

The asset-image works with SC9.3+, this include the latest SC10 release.

Docker Hub

The SFE assets image can be found in Docker Hub. https://hub.docker.com/r/bverdonck/sitecore-forms-extensions-assets

The module consists of 3 roles to enrich: CM, CD and MSSQL.

Setup

.ENV

In the .ENV file, add a variable SFE_VERSION.

Set the variable to the version you want to use. (Currently only 3.0.0-1809 is available)

CM + CD Role

In docker-compose.overwrite.yml, navigate to the cm section. Add SFE_IMAGE: bverdonck/sitecore-forms-extensions-assets:${SFE_VERSION} to the arguments that are passed to the build script.

Open the CM Dockerfile (usualy located under docker/build/cm/Dockerfile). Add ARG SFE_IMAGE to accept the image argument, add the handle FROM ${SFE_IMAGE} as sfe. And finally add the copy instruction COPY –from=sfe \module\cm\content .\

That’s it for the CM image. Please repeat these steps for the CD image.

MSSQL

We need to update the MSSQL image as well, so that the Sitecore items of the modules are installed into your databases.

Start by updating the docker-compose.override.yml to pass the SFE_IMAGE into the mssql image build.

Next open the mssql dockerfile build (docker/build/mssql/Dockerfile).

Import the SFE_Image and copy the dacpac’s into the image, add the commando to run the deploydatabases powershell script.

Leave a Reply