development · docker · framework

Playing around with Sitecore Docker Containers and my simple development framework version 2.6

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:

As a consequence, my simple Sitecore development framework version 2.6 is out.

Prerequisites

Step-by-step Set Up

  1. please ensure performing Step 1 -> 8 in the set-up of Sitecore Docker Images  if NOT YET
  2. 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
    • msdf26_1
    • (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
    • msdf26_2
    • hopefully will see something like this after a loooooooooooog operation
    • msdf26_3
    • 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
    • This slideshow requires JavaScript.

  3. download the version 2.6 and then unzip it to D:\my-simple-framework
  4. 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
    • msdf26_7
    • msdf26_5
    • 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
      • msdf26_11
      • change directory to D:\my-simple-framework\Docker\traefik\certs
      • execute mkcert “*.viethoang.local”
      • msdf26_12
    • 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.
      • msdf26_8
    • execute docker-compose up –build
    • msdf26_9
    • let’s see how many containers and their own info by opening another Windows PowerShell (run as administrator) and then execute docker container ls
    • msdf26_10
    • ensure that there is a container of docker image sitecore-xp-standalone:9.3.0-windowsservercore-1909
  5. 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
    • msdf26_14
  6. open a browser, navigate to https://sc.viethoang.local/, we would see the default Sitecore page with a valid SSL certificate
    • msdf26_13
  7. 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
    • msdf26_16
    • BuildToolVersions to your MS Build version on your own machine (Ex: “VS2019”)
    • msdf26_15
    • 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
    • msdf26_17
    • msdf26_18
  8. 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
  • msdf26_21

Additional one

 

Happy Sitecore Docker and Coding!

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.