So I’ve had a chance to play around with the set-up of Sitecore Docker Images recently. Now I wanted to deploy the Sitecore solution of my simple development framework to Sitecore Docker containers as well. By learning from the following awesome articles from the Sitecore community, I finally can achieve that:
- Deploying and Debugging Your Visual Studio Solution to Your Sitecore Docker Containers by Mark Cassidy
- Sitecore Docker containers + Traefik v2 + self signed SSL certificates by Rey Rahadian
As a consequence, my simple Sitecore development framework version 2.6 is out.
Prerequisites
- Windows Server Core, version 1903 / 1909
- Sitecore XP version 9.3.0
- Sitecore license
- Note: you can request it via Sitecore free Developer Trial Program
- Sitecore certified account on Sitecore Downloads
- mkcert
- Traefik
Step-by-step Set Up
- please ensure performing Step 1 -> 8 in the set-up of Sitecore Docker Images if NOT YET
- let’s build docker images of Sitecore 9.3.0 on Windows Server Core version 1909
- open Windows PowerShell (run as administrator)
- change directory to D:\ScDocker\docker-images
- execute .\build -SitecoreVersion “9.3.0” -OSVersion “1909” and then enter username / password of your Sitecore certified account on Sitecore Downloads
- (optional) in D:\ScDocker\docker-images, create packages folder manually and then copy / paste all the following Sitecore packages are compatible with 9.3 version to “D:\ScDocker\docker-images\packages” folder
- hopefully will see something like this after a loooooooooooog operation
- Note: we should remove unused images (dangling images created during build) as well to save a lot of disk space by executing docker image prune ‐‐force
- download the version 2.6 and then unzip it to D:\my-simple-framework
- let’s spin up Sitecore 9.3.0 instances
- stop IIS web server and windows services if any (normally, they’re using port 80 / 443 / 8080 same as traefik service in D:\my-simple-framework\Docker\docker-compose.yml), otherwise will see the error message later ERROR: for traefik Cannot start service traefik: Ports are not available
- let’s generate SSL certificate as we want to access Sitecore sites with HTTPS protocol by using mkcert
- open Windows PowerShell (run as administrator)
- execute choco install mkcert
- change directory to D:\my-simple-framework\Docker\traefik\certs
- execute mkcert “*.viethoang.local”
- open Windows PowerShell (run as administrator)
- change directory to D:\my-simple-framework\Docker\
- execute .\Set-LicenseEnvironmentVariable.ps1 -Path C:\license\license.xml
- Note: ensure that this file C:\license\license.xml is available as well, otherwise will see this error message later License file is not found.
- execute docker-compose up –build
- let’s see how many containers and their own info by opening another Windows PowerShell (run as administrator) and then execute docker container ls
- ensure that there is a container of docker image sitecore-xp-standalone:9.3.0-windowsservercore-1909
- add the following ones to hosts file (normally, it’s in C:\Windows\System32\drivers\etc) so traefik service is able to work properly
- 127.0.0.1 sc.viethoang.local
- 127.0.0.1 hoavi.viethoang.local
- 127.0.0.1 demo.viethoang.local
- open a browser, navigate to https://sc.viethoang.local/, we would see the default Sitecore page with a valid SSL certificate
- let’s deploy the Sitecore solution
- rename D:\my-simple-framework\cake-config.json.example to cake-config.json then update the following ones
- WebsiteRoot to deploy folder which is mounted to docker container
- BuildToolVersions to your MS Build version on your own machine (Ex: “VS2019”)
- rename D:\my-simple-framework\Common.LocalSettings.config.example to Common.LocalSettings.config
- open Windows PowerShell (run as administrator)
- change directory to D:\my-simple-framework
- execute .\build -target Deploy-Docker
- open a browser, navigate to the following ones to access Sitecore sites with HTTPS protocol in the docker environment
Note: take a look at the following steps to shutdown all the containers
- open Windows PowerShell (run as administrator)
- change directory to D:\my-simple-framework\Docker
- execute docker-compose down
Additional one
Happy Sitecore Docker and Coding!
3 thoughts on “Playing around with Sitecore Docker Containers and my simple development framework version 2.6”