Tailwind Logo

Preparing the environment to run Sitecore XM1 on Docker

Docker

Published: 2022-05-10

Previously, this blog covered running Sitecore on Windows Server using Docker. This time, we'll introduce the steps to launch Sitecore 10.2 XM version (CMS mode). Future content will be based on this article.

A list of previous articles is provided at the end of this page for reference.

Environment Preparation

For the demo environment we will be creating, we will proceed with the following environment, keeping in mind the actual development environment.

  • Windows 11 Professional
  • Visual Studio Code
  • Git for Windows
  • GitHub Desktop
  • Docker for Windows
  • NodeJs 14.x
  • Visual Studio 2022
  • .NET Core 3.1
  • .NET Framework 4.8

In addition, 16GB of memory is a little insufficient for the environment. First, enable Hyper-V on Windows 11 Pro by running PowerShell with administrative privileges and executing the following command

PowerShell
Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All

When the installation is complete, you will be prompted to reboot. Windows Subsystem for Linux must then also be installed.

PowerShell
wsl --install

Download the module from the following page and perform the installation.

wsl1.png

The update is performed by executing the file downloaded from the page above.

wsl2.png

Next, we would like to use chocolatey this time as an installer to install various tools.

PowerShell
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
docker01.png

The installation is completed and the version check is as follows.

docker02.png

Once the installation is complete, proceed with the installation on the command line as follows

Installing Visual Studio Code

PowerShell
choco install vscode
docker03.png

After installation is complete, add Japanese resources as extensions.

docker17.png

We will also add Docker extensions as they are useful to include.

docker18.png

Git for Windows

Install Git for Windows.

PowerShell
choco install git
docker04.png

GitHub Desktop

If you are used to working with git commands, that's fine, but we will be posting articles on this blog in a form that uses GitHub Desktop for its ease of use.

PowerShell
choco install github-desktop

During the installation process, the application will launch and ask if you want to log in with your GitHub account.

docker05.png

You may choose to skip this step, or you may log in with your GitHub account that you use daily.

Docker for Windows

Install Docker for Windows.

PowerShell
choco install docker-desktop
docker06.png

In order to start Docker Desktop, you must sign out and sign back in. After signing in again, you will be presented with a screen that asks for your permission to use the software.

docker07.png

When completed, the screen will switch to the startup screen.

docker08.png

Switch to Windows Containers. To switch, right-click the Docker icon in the task tray and select `Switch to Windows Containers`.

docker09.png
docker10.png

After switching, now right-click and click Settings to open the configuration. As for the action, select the Docker Engigne option and configure it as follows

JSON
{
  "experimental": true
}
docker11.png

Finally, please uncheck the box regarding the Use Docker Compose V2 item on the configuration screen.

docker12.png

This completes the Docker for Windows configuration.

Installing mkcert

Install mkcert, a command used for self-certification, etc.

PowerShell
choco install mkcert
mkcert -install
docker13.png

Installing Node.js

Install Node.js, specifying the LTS version when installing Node.js.

PowerShell
choco install nodejs-lts
docker14.png

Installing Visual Studio 2022 Professional

Install Visual Studio 2022 Professional. Download the installer from the Microsoft website, install, and finally activate it to complete the process.

docker15.png

Install the Sitecore Docker Tool

A useful tool to assist with installation is the Sitecore Docker Tools, which can be downloaded from the Sitecore Gallery and installed by executing the following commands.

PowerShell
Register-PSRepository -Name "SitecoreGallery" -SourceLocation "https://sitecore.myget.org/F/sc-powershell/api/v2"
Install-Module SitecoreDockerTools

When confirmation comes at the command prompt, use Y or A to proceed.

docker19.png

Deployment of License File

Save the license file in the folder c:\projects\license

docker16.png

Summary

We have previously shown how to use Docker on Windows Server 2019, but as shown here, you can prepare an environment on Windows 10/11 Pro as long as you have a Hyper-V enabled machine.

Related article

Tags