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.

4 thoughts on “Container support for Sitecore Forms Extensions

  1. Bart says:

    Hi Bart

    I followed your guide to add SFE to docker. However I get an error when building docker.

    “ERROR: Service ‘mssql’ failed to build : invalid from flag value sfe: pull access denied for sfe, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied.”

    SFE_VERSION is set to: 3.2.0-1809
    SFE_IMAGE: SFE_IMAGE: bverdonck/sitecore-forms-extensions-assets:${SFE_VERSION}

    Any thoughts how I can resolve this?

    Hendrik

    Reply
    1. bart.verdonck says:

      Strange, the images are public, do you still experience this issue?

      Reply
      1. Jeremy says:

        I had same error but put full url including domain in docker compose and it worked. e.g docker.io/bverdonck/sitecore-forms-extensions-assets:4.0.2-1809

        Reply
  2. GB says:

    Hi Bart,
    I am having this issue when sending email with ReCaptcha

    “Unknown method ‘GetStringValue’ (type: Feature.FormsExtensions.Fields.ReCaptcha.ReCaptchaModel)”

    Without ReCaptcha everything works fine.

    Using sitecore 10.1 with containers
    SFE version : 4.0.2-1809

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *