...
Create a folder location for the new Docker images. Repeat the following steps for Score, ScoreUI and Score Bootstrap
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
Extract the scwdp created in step 1
Copy all ‘$scwdpRoot\Content\Website’ files and folders to ‘$imageFolderRoot\module\cm\content’
Copy the Core(if applicable) and Master dacpacs from the scwdp root folder to ‘$imageFolderRoot\module\db’
Rename the dacpacs to Sitecore.Core.dacpac (if applicable) and Sitecore.Master.dacpac - This is important, and will not work if skipped.
Create a repo on Docker Hub if this is the first time through these steps
Create a Dockerfile in the image root folder and add:
Code Block FROM mcr.microsoft.com/windows/nanoserver:1809 AS build # Copy assets into the image, keeping the folder structure COPY \ .\
Build the image
Code Block docker build --tag repo/scoreImageName:1.0.0.0
Run the image to verify the module folder has been copied in
Code Block docker run -it repo/scoreImageName:1.0.0.0
Push to docker hub
Code Block docker push repo/scoreImageName:1.0.0.0
There should now be 3 images: one for Score, one for ScoreUI and one for ScoreBootstrap
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
Update the ‘docker\build\mssql-init’ Dockerfile
Code Block ARG SCORE_IMAGE ARG SCORE_UI_IMAGE ARG SCORE_BOOTSTRAPUI_IMAGE ...... FROM ${SCORE_IMAGE} as score FROM ${SCORE_UI_IMAGE} as scoreui FROM ${SCORE_BOOTSTRAPUI_IMAGE} as scorebootstrap ...... # Add Score Base COPY --from=score C:\module\db C:\resources\score # Add SPE module COPY --from=scoreui C:\module\db C:\resources\scoreui # Add SPE module COPY --from=scorebootstrap C:\module\db C:\resources\scorebootstrap
Note: For the versions prior to 10.2, this would be in ‘docker\build\mssql', as 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.
Update the ‘docker\build\cm’ Dockerfile
Code Block ARG SCORE_IMAGE ARG SCORE_UI_IMAGE ARG SCORE_BOOTSTRAPUI_IMAGE ...... FROM ${SCORE_IMAGE} as score FROM ${SCORE_UI_IMAGE} as scoreui FROM ${SCORE_BOOTSTRAPUI_IMAGE} as scorebootstrap ...... # Add Score Base COPY --from=score \module\cm\content .\ # Add Score UI COPY --from=scoreui \module\cm\content .\ # Add Score Bootstrap COPY --from=scorebootstrap \module\cm\content .\ ......
Add score.license file to ‘docker\src\App_Data’ folder.
Run ‘docker-compose up -d’ to kick off the image builds and bring up the containers.