Walkthrough: Preparing to install the SCCH connector module in a container environment

Abstract

How to prepare the installation files and Docker images needed for installing the Sitecore Connect for Content Hub connector in a container environment.

To prepare for adding the Sitecore Connect for Content Hub (SCCH) connector to your installation, regardless of whether you are deploying to Docker or Azure Kubernetes service, follow the steps in this walkthrough.

This walkthrough describes how to:

  • Prepare the installation files

  • Build the Docker images

To prepare the files required for the installation:

  1. Download the SCCH container deployment package from the Sitecore download page. Extract it to your local workstation with the folder structure intact.

  2. Download the Sitecore Experience Platform container deployment package from the Sitecore download page. Extract it to a new folder on your local workstation with the folder structure intact. Name the new folder, for example, SCCH.

  3. In the folder where you extracted the SCCH package in Step 1, navigate to the folder for the Windows version and topology you are using, for example, SCCH\compose\ltsc2019\xp1. Copy the docker-compose.override.yml file to the SCCH\compose\<version>\<topology> folder you created in Step 2.

  4. In the SCCH folder, navigate to the folder for your Windows version and topology you are using, for example, compose\ltsc2019\xp1. Open the .env file in a text editor. At the bottom of the file, add a definition for the SCCH image. For example:

    SCCH_IMAGE= scr.sitecore.com/sxp/modules/sitecore-chub-assets:5.0.0-<target-OS-to-deploy>
  5. In the folder where you extracted the SCCH package, open the .env-example file in a text editor, and copy all the contents.

  6. At the bottom of the .env file from Step 4, after the SCCH image data, paste in the contents from the .env-example file. Save the .env file.

When you have prepared the installation files, you must create Docker files for each role and build the Docker images.

Note

For more information on image assets, see the documentation on how to Add Sitecore Modules.

To build the images:

  1. In the SCCH folder, navigate to the folder for your Windows version and topology you are using, for example, compose\ltsc2019\xp1. Create a subfolder and name it module.

  2. In the module folder, create the following subfolders:

    • cm

    • cd

      Note

      You only have to create the cd subfolder if you are deploying to an XP1 or XM1 topology.

    • mssql

      Note

      You only have to create the mssql subfolder if you are deploying to Sitecore 10.1.3 on Docker.

    • mssql-init

      Note

      You only have to create the mssql-init subfolder if you are deploying to Sitecore 10.1.3 on Kubernetes.

  3. In each subfolder, create a new file and name it Dockerfile.

  4. In the cm folder, in the Dockerfile file, enter the following instructions:

    # escape=`
    ARG BASE_IMAGE
    ARG SCCH_IMAGE
    ARG TOOL_IMAGE
    
    FROM ${SCCH_IMAGE} as scch
    FROM ${TOOL_IMAGE} as tooling
    FROM ${BASE_IMAGE}
    
    SHELL [“powershell”, “-Command”, “$ErrorActionPreference = ‘Stop’; $ProgressPreference = ‘SilentlyContinue’;”]
     	
    WORKDIR C:\inetpub\wwwroot
    
    # Add SCCH module
    COPY –from=scch \module\cm\content .\
    
    # Add tools from  itecore-docker-tools-assets
    COPY –from=tooling \tools\ C:\tools\
    
    # Apply SCCH transformation files
    RUN C:\tools\scripts\Invoke-XdtTransform.ps1 -Path C:\inetpub\wwwroot -XdtPath \inetpub\wwwroot\App_Data\Transforms\scch\xdts
    
  5. If you are deploying an XP1 or XM1 topology, in the cd folder, in the Dockerfile file, enter the following instructions:

    # escape=`
    ARG BASE_IMAGE
    ARG SCCH_IMAGE
    ARG TOOL_IMAGE
    
    FROM ${SCCH_IMAGE} as scch
    FROM ${TOOL_IMAGE} as tooling
    FROM ${BASE_IMAGE}
    
    SHELL [“powershell”, “-Command”, “$ErrorActionPreference = ‘Stop’; $ProgressPreference = ‘SilentlyContinue’;”]
    
    WORKDIR C:\inetpub\wwwroot
    
    # Add SCCH module
    COPY –from=scch \module\cm\content .\
    
    # Copy SCCH transformation files
    COPY –from=scch \module\transforms\ C:\transforms\
    
    # Add tools from  itecore-docker-tools-assets
    COPY –from=tooling \tools\ C:\tools\
    
    # Apply SCCH transformation files
    RUN C:\tools\scripts\Invoke-XdtTransform.ps1 -Path C:\inetpub\wwwroot -XdtPath \inetpub\wwwroot\App_Data\Transforms\scch\xdts 
    RUN C:\tools\scripts\Invoke-XdtTransform.ps1 -Path C:\inetpub\wwwroot -XdtPath \transforms\cd
  6. If you are deploying to Sitecore 10.1.3 in Docker, in the mssql folder, in the Dockerfile file, enter the following instructions:

    # escape=`
    ARG BASE_IMAGE
    ARG SCCH_IMAGE
    
    FROM ${SCCH_IMAGE} as scch
    FROM ${BASE_IMAGE}
    
    SHELL [“powershell”, “-Command”, “$ErrorActionPreference = ‘Stop’; $ProgressPreference = ‘SilentlyContinue’;”]
    
    # Copy SCCH dacpac files
    COPY –from=scch C:\module\db C:\resources\scch_data
    
    # Copy SCCH tool files
    COPY –from=scch C:\module\tools\ C:\scch\
    
    #  Deploy SCCH dacpac files
    RUN C:\scch\Set-DbContainmentLevel.ps1 -moduleDacpacSource C:\resources\scch_data -isContainer $true; `
    Remove-Item -Path C:\scch -Recurse -Force; `
    C:\DeployDatabases.ps1 -ResourcesDirectory C:\resources\scch_data; `
    Remove-Item -Path C:\resources\scch_data -Recurse -Force;
  7. If you are deploying to Sitecore 10.1.3 in Kubernetes, in the mssql-init folder, in the Dockerfile file, enter the following instructions:

    # escape=`
    ARG BASE_IMAGE
    ARG SCCH_IMAGE
    
    FROM ${SCCH_IMAGE} as scch
    FROM ${BASE_IMAGE}
    
    SHELL [“powershell”, “-Command”, “$ErrorActionPreference = ‘Stop’; $ProgressPreference = ‘SilentlyContinue’;”]
    
    # Copy SCCH dacpac files
    COPY –from=scch C:\module\db C:\resources\scch_data
    
    # Copy SCCH tool files
    COPY –from=scch C:\module\tools\ C:\scch\
    
    #  Prepare SCCH dacpac files
    RUN C:\scch\Set-DbContainmentLevel.ps1 -moduleDacpacSource C:\resources\scch_data -isContainer $true; `
    Remove-Item -Path C:\scch -Recurse -Force;# escape=`
    ARG BASE_IMAGE
    ARG DCRMCNN_IMAGE
    
    FROM ${DCRMCNN _IMAGE} as dcrm
    FROM ${BASE_IMAGE}
    
    SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
    
    # Deploy DCRM Staging database file
    COPY --from=dcrm  C:\module\db C:\resources\dcrm
  8. Navigate to the SCCH\compose\<version>\<topology> folder. Open the docker-compose.override.yml file for edit, and add the following instructions for the cm image:

    cm:
        image: sitecore-chub-${TOPOLOGY}-cm:${SITECORE_VERSION}
        build:
          context: ./module/cm
          args:
            BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cm:${SITECORE_VERSION}
            SCCH_IMAGE: ${SCCH_IMAGE}
            TOOL_IMAGE: ${TOOL_IMAGE}
  9. If you are deploying to an XP1 or XM1 topology, add these instructions for the cd image:

     	cd:
        image: sitecore-chub-${TOPOLOGY}-cd:${SITECORE_VERSION}
        build:
          context: ./module/cd
          args:
            BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cd:${SITECORE_VERSION}
            SCCH_IMAGE: ${SCCH_IMAGE}
            TOOL_IMAGE: ${TOOL_IMAGE}
  10. If you are deploying to Sitecore 10.1.3 in Docker, add these instructions for the mssql image:

     mssql:
        image: sitecore-chub-${TOPOLOGY}-mssql:${SITECORE_VERSION}
        build:
          context: ./module/mssql
          args:
            BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-mssql:${SITECORE_VERSION}
            SCCH_IMAGE: ${SCCH_IMAGE}
  11. If you are deploying to Sitecore 10.1.3 in Kubernetes, add these instructions for the mssql-init image:

    mssql-init:
        image: sitecore-chub-${TOPOLOGY}-mssql-init:${SITECORE_VERSION}
        build:
          context: ./module/mssql-init
          args:
            BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-mssql-init:${SITECORE_VERSION}
            SCCH_IMAGE: ${SCCH_IMAGE}
  12. In the Windows console, go to the SCCH\compose\<version>\<topology> folder where the docker-compose.override.yml file is. Run the following command:

    docker-compose build
  13. If you are deploying to Docker, continue with the instructions in Add the SCCH connector module to Sitecore in Docker.

    If you are deploying to Kubernetes, continue with the instructions in Walkthrough: Adding the SCCH connector module to Sitecore in Azure Kubernetes Service.

Note

Some modifications to Sitecore deployments, such as adding connection strings or changing the web configuration files, require you to use configuration transforms to change the configuration files. For information on how to apply configuration transforms, see the Sitecore container development documentation.