A step by step guide to install a docker
Published: 27 July 2022

For installing a docker, first of all these are certain prerequisites and requirements that you must fulfil. They are:
- Docker Desktop Installed on Windows Desktop
- Docker Desktop support for windows containers
- 32 GB RAM Quad core Processor CPU
- Visual studio professional or enterprise (You can install it from here:
https://visualstudio.microsoft.com/downloads/) - Install any (12+ suggested) stable versions of NodeJS (You can install them from here:
https://nodejs.org/en/) - Install PowerShell (https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.1)
- You can check your installed PowerShell version with the $PSVersionTable command!
- After that, run the following PowerShell scripts in Administrator mode.
- Enable Windows features
- Enable-WindowsOptionalFeature -Online -FeatureName containers -All
- Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V –All
Alternative option would be to enable the features above from the Turn Windows features on and off!
How to install the docker?
- Download the docker from
https://www.docker.com/get-started - If you have a windows server, you can ever try installing the docker from PowerShell using a module.
https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server) - Please note, if you install the docker like shown above, you need to edit/create the needed configuration file manually (as it does not exist by default). Read more here: (https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/configure-docker-daemon*)
- Sample Docker config:
{
"dns": ["8.8.8.8"],
"data-root": "d:\\docker-data",
"debug": false,
"hosts": [],
"registry-mirrors": [],
"insecure-registries": []
} - Make sure that virtualization is enabled in your BIOS (in case of a VM you cannot do this)
- After the docker has been installed successfully, you have to switch to Windows containers.
- Open the Docker desktop menu by right clicking on the icon in the taskbar Click on Switch to Windows Containers.
- Copy Sitecore License to **c:\license folder**, so your license should be available on** c:\license\license.xml** path.
- Please make sure you are using a valid, up to date license file! If at all you are not sure, reach out to the team.
- If you have locally installed Solr which listens to the 8984 port, you have to stop that Solr Instance.
- If your local IIS is listening on port 443, you will need to stop it.
- This requires an elevated PowerShell or command prompt. iisreset /stop.
- If you are using a newer Docker than 3.4.0, you should disable V2 compose features by the following command.
```
docker-compose disable-v2
``` - If you used PowerShell to install the Docker Engine (e.g.: on a Windows Server) you need to install Docker Compose by hand:(https://docs.docker.com/compose/install/ and it won't be the Compose CLI).
Required & Optional Docker Configuration
Optional: Changing the Docker data location. (e.g moving the data folder to a different drive)
- Add "data-root":"d:\\docker-data" node to the Docker Engine settings (obviously change the drive letter to the one you use/have).
Required: If the application within the container cannot access internet (e.g.: calling Jitterbit)
- Add "dns":["8.8.8.8"] node to the Docker Engine settings
(this is Google's DNS IP address).
How to spin up the project?
- If you have IIS running, stop it
- Open PowerShell (or CMD) in Administrator mode
- Checkout the project from this repository
- Create a copy of the **.env-template** file, and name it to **.env** (.env file is on GitIgnore)
- Call init.ps1 PowerShell script
- Important!
- This step will register sitename.localhost and id.sitename.localhost URL in your host file and it will point to 127.0.0.
``` - .\init.ps1
``` - If you get a Warning window, you can accept it and add the certificates:
- 
- Type the following command to spin up the site
```
- docker-compose up -d
```
(If this is the first time when you start the site, you may need to restart CM container to flush SC caches, otherwise SXA site will not be served/found)
- Stopping containers:
```
docker-compose down --remove-orphans
So, this was a step-by-step guide on how to install a docker!

Mitesh Patel - Technical Head - ADDACT
Sitecore || XMCloud || OrderCloud Certified
Mitesh, a distinguished Technical Head at Addact/Addxp, is a prominent figure in Sitecore/XMCloud/OrderCloud certified writing. From Sitecore XM Cloud Developer Certification to Sitecore 10 .NET Developer Certification and Sitecore OrderCloud Certification, Mitesh's expertise is unparalleled. Mitesh is not only a skilled Sitecore CMS developer but also a 12+ years experienced software engineer proficient in various technologies such as MVC, ASP.Net, C#, jQuery, and Azure cloud/AWS.