Tailwind Logo

Using Sitecore Docker Custom Images - Initial Setup

Docker

Published: 2022-05-26

So far, we have been testing the operation by launching a sample Docker image, but in reality, we will be creating an image that contains the modules we will need. This time, we will create a custom image that you want to use yourself from the sample.

Docker Samples

Sample custom images are deployed in the following repositories

Download this repository.

customimage01.png

Copy the folder C:\projects\docker-examples\custom-images to C:\projects\sitecoredemo-jp and work in this folder from now on.

Creating a configuration file

To create the .env file, first run init.ps1. As before, once executed, we will modify the .env file. In this sample init.ps1, the administrator password is embedded, so only the license file is specified.

PowerShell
.\init.ps1 -LicenseXmlPath C:\projects\license\license.xml
customimage02.png

The script will configure the necessary items in the .env file. First, we will change the host name. In this case, we will change it as follows

Plain Text
CD_HOST=cd.sitecoredemojp.localhost
CM_HOST=cm.sitecoredemojp.localhost
ID_HOST=id.sitecoredemojp.localhost
HRZ_HOST=hrz.sitecoredemojp.localhost

We will also add this domain to the host file.

PowerShell
Add-HostsEntry "cd.sitecoredemojp.localhost"
Add-HostsEntry "cm.sitecoredemojp.localhost"
Add-HostsEntry "id.sitecoredemojp.localhost"
Add-HostsEntry "hrz.sitecoredemojp.localhost"

The following items should also be changed from their default values.

Plain Text
SITECORE_ADMIN_PASSWORD
SQL_SA_PASSWORD

The certificate is created as follows Move to the folder docker\traefik\certs and create the file with the mkcert command.

PowerShell
mkcert -key-file key.pem -cert-file cert.pem "*.sitecoredemojp.localhost"
customimage03.png

Running XM images

The sample includes sample files that can boot XP and XM. This time, to start with the xm1 configuration, specify the file and start as follows.

PowerShell
docker-compose -f docker-compose.xm1.yml -f docker-compose.xm1.override.yml up -d
customimage04.png

It will take some time to build the image, etc., so please wait a while with a drink.

customimage05.png

Access a sample site

Once all containers have been activated as described above, please access the site. First, access the management server and you will see the following

customimage06.png

Once logged in, the administration screen will appear.

customimage07.png

The system was successfully activated.

Summary

This time, we will run the sample to the point of starting it up as a base. In the next issue, we will customize it so that we can remove unnecessary parts and base it on the actual project.

Related article

Tags