commerce · docker

How to run Sitecore Commerce by using Sitecore Docker images and Windows containers

So I’ve had a chance to play around with the set-up of Sitecore Docker Images recently. Now I wanted to run Sitecore Commerce version 9.3 by using Sitecore Docker images and Windows containers as well.

There are some hiccups during my own journey, however, these following links are helpful for me:

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 XC 9.3.0 on latest LTSC (Long Term Support Channel) Windows version
    • open Windows PowerShell (run as administrator)
      • change directory to D:\ScDocker\docker-images
      • Note: at this moment, the latest Sitecore version is 9.3 and we can use –SitecoreVersion parameter to build image of other versions as well
      • Ex: .\build -SitecoreVersion “9.2.0” -Topology “xp”, “xc” -IncludeSxa -IncludeSpe
    • execute .\build -Topology “xp”, “xc” -IncludeSxa -IncludeSpe and then enter username / password of your Sitecore certified account on Sitecore Downloads
    • docker_xc_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
    • docker_xc_2
    • 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. ensure that this file C:\license\license.xml is available, otherwise will see this error message later License file is not found. or “License not found at ‘C:\license\license.xml'”
    • This slideshow requires JavaScript.

  4. ensure that port 4200 is NOT in used (normally, we should stop IIS web server and windows services if any)
    • docker_xc_13
  5. install whales-names so we can configure XC’s DNS names such as cm, cd, identity, bizfx, etc automatically as internal container IP may be different after executing docker-compose up / down
    • docker_xc_7
  6. (optional) the virtual machine isolation mode should be hyperv in D:\ScDocker\docker-images\windows\tests\9.3.x\.env rather than process
    • docker_xc_5
    • otherwise, we may get the following error Cannot start service
    • docker_xc_6
  7. let’s spin up Sitecore XC 9.3 instances with SXA Storefront
    • open Windows PowerShell (run as administrator)
    • change directory to D:\ScDocker\docker-images
    • execute .\Set-LicenseEnvironmentVariable.ps1 -Path C:\license\license.xml
    • change directory to D:\ScDocker\docker-images\windows\tests\9.3.x
      • Note: if we switch between versions, variants or topologies, we will have to clear the data folders by executing .\Clean-Data
      • docker_xc_25
    • execute docker-compose -f docker-compose.xc.sxa.storefront.yml up -d
    • docker_xc_8
  8. let’s configure DNS names automatically
    • open Windows PowerShell (run as administrator)
    • execute whales-names
    • docker_xc_10
    • hopefully we would see something like the following ones in hosts file (normally, it’s in C:\Windows\System32\drivers\etc)
    • docker_xc_9
  9. log into Sitecore (admin / b) and then verify the following ones:
    • Note: always click Cancel button if there is a certificate dialog box
    • docker_xc_17
    • This slideshow requires JavaScript.

  10. perform the following Sitecore Commerce post-install steps using Postman
  11. ensure that Habitat catalog is present on both BizFx and CM
    • Note: always click Cancel button if there is a certificate dialog box
    • docker_xc_17
    • This slideshow requires JavaScript.

  12. log into Sitecore (admin / b) and then:
    • ensure that Sitecore Commerce templates is NOT out of sync by hitting Update Data Templates in the COMMERCE tab of Content Editor
    • docker_xc_22
    • set up a Storefront whose host name is cd by following Create a Commerce tenant and site
    • docker_xc_18
    • perform a full publish
    • perform an index rebuild of sitecore_web_index and sitecore_sxa_web_index
    • docker_xc_23
  13. let’s access the Storefront on CD https://cd and then try adding some products
    • docker_xc_21

Note: some known issues

  1. an error has occurred while executing docker-compose -f docker-compose.xc.sxa.storefront.yml up -d
    • Cannot start service … context deadline exceeded …
    • docker_xc_24
    • my suggestion is to quit Docker Desktop and then run it again
  2. Unable to convert type
    • docker_xc_19
    • my suggestion is to ensure that Sitecore Commerce templates is NOT out of sync by hitting Update Data Templates in the COMMERCE tab of Content Editor
    • docker_xc_22

Happy Sitecore Docker!

4 thoughts on “How to run Sitecore Commerce by using Sitecore Docker images and Windows containers

  1. Hello Viet,

    I’m getting this error. Any idea?

    curl: (6) Could not resolve host: github.com
    Expand-Archive : The path ‘C:\downloads\redis.zip’ either does not exist or
    is not a valid file system path.
    At line:1 char:304
    + … S_VERSION); Expand-Archive -Path C:\downloads\redis.zip -Destination …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (C:\downloads\redis.zip:String
    ) [Expand-Archive], InvalidOperationException
    + FullyQualifiedErrorId : ArchiveCmdletPathNotFound,Expand-Archive

    Like

Leave a comment

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