Configure SCORE Solution with Docker

This article will outline how Docker images were built with Sitecore 10.2.0 and Score 3.5.15. With these images, any developers with access to the Docker Hub repo they are stored on can run a Sitecore instance with Score already installed using Docker.

Building out an asset image has already been documented, but Score comes as three separate packages that need to each be layered into the docker build.

Note: This was done on Sitecore version 10.2.0, older versions may require changes.

 

This process involves converting the Score, ScoreUI and ScoreBootstrap .update packages into Sitecore Web Deploy packages for use in the Docker image build. All three need to be layered in as they currently released as separate Nuget packages, but are all required to run Score.

  1. From the Score template solution, navigate to the .update packages (ex ‘\packages\Score.10.2.0.3.5.15\tools\packages’), and convert each to Web Deploy packages

Note, to avoid file path length issues/errors, it is a good idea to copy the .update packages to ‘c:\’ before running the tool.

  1. Create a folder location for the new Docker images. Repeat the following steps for Score, ScoreUI and Score Bootstrap

    1. Follow https://medium.com/@mitya_1988/how-to-create-a-docker-asset-image-for-your-sitecore-module-58e1f3a47672 to create the Score images, or follow the steps below

      1. Extract the scwdp created in step 1

      2. Copy all ‘$scwdpRoot\Content\Website’ files and folders to ‘$imageFolderRoot\module\cm\content

      3. Copy the Core (if applicable) and Master dacpacs from the scwdp root folder to ‘$imageFolderRoot\module\db

      4. Rename the dacpacs to Sitecore.Core.dacpac (if applicable) and Sitecore.Master.dacpac - This is important, and will not work if skipped.

      5. Create a repo on Docker Hub if this is the first time through these steps

      6. Create a Dockerfile in the image root folder and add:

        FROM mcr.microsoft.com/windows/nanoserver:1809 AS build # Copy assets into the image, keeping the folder structure COPY \ .\
      7. Build the image

        docker build --tag repo/scoreImageName:1.0.0.0
      8. Run the image to verify the module folder has been copied in

        docker run -it repo/scoreImageName:1.0.0.0
      9. Push to docker hub

    2. There should now be 3 images: one for Score, one for ScoreUI and one for ScoreBootstrap

    3. Add SCORE_IMAGE, SCOREUI_IMAGE, SCORE_BOOTSTRAPUI_IMAGE args to the mssql-init and cm container definitions in the docker-compose.override.yml, and change the image name in order to produce a new image for each (ex sitecore-xp-spe-tools-score-cm):

      • SCORE_IMAGE: repo/scoreImageName:1.0.0.0

      • SCOREUI_IMAGE: repo/scoreUIImageName:1.0.0.0

      • SCORE_BOOTSTRAPUI_IMAGE: repo/scoreBootstrapImageName:1.0.0.0

    4. Update the ‘docker\build\mssql-init’ Dockerfile

      Note: For the versions prior to 10.2, this would be in ‘docker\build\mssql', similar to how it is described in the article in step a. The ‘RUN DeployDatabases’ and ‘Remove-Item' would then also need to be added.

    5. Update the ‘docker\build\cm’ Dockerfile

  2. Add score.license file to ‘docker\src\App_Data’ folder.

  3. Run ‘docker-compose up -d’ to kick off the image builds and bring up the containers.