As the IT industry has increasingly started embracing containerization, it has become a cornerstone of modern software development. Sitecore is not an exception. Sitecore announced official support for containers from the version 10 initial release. Since then all of us have started using Docker Desktop to run Sitecore’s containerized solution.
If you are new to Docker and Containers, You can go through Bootcamp on Docker by my friend Eric Sanner.
Docker Bootcamp Blog Series
But Docker Desktop is paid for commercial use. As I do not use its GUI much except for some nominal work, I thought of looking for its alternatives. Surprisingly, I learned that running Containers without Docker Desktop is possible.
This is roughly the composition of Docker Desktop. Under the hood, it utilizes Docker Engine. Additionally, it provides a decent Graphical interface to interact with Docker Engine.
It is good to have but not a necessity. All you need is a Docker Engine.
It is an open-source containerization technology for building and containerizing your applications.
Let us set up a Docker Engine on your machine to run Windows Containers.
Note : Though this article specifically targets Sitecore Containers, This Docker Engine setup process should be common for all those who wish to run Windows Containers.
There are a few really helpful articles about how to do it. Thank you for giving me a head start !!
Unfortunately, I already had Docker Desktop installed so I landed into a few issues. While fixing those I realized that it is better to pristine my machine. If you don’t, you may face weird issues due to unremoved files of the Docker Desktop.
Now let’s start with the action !!
Disclaimer – This will remove all your containers and images but eventually it will be downloaded when you run your instance.
-
Clean up
- Uninstall ‘Docker Desktop’ from your machine
- You can try running ‘docker version’ after uninstallation which should throw an error saying ‘docker is not recognized’
- Even after uninstallation, a few files remain buried in your drive. Let’s remove them if present (if removing does not work, you can rename it like adding a ‘-old’ suffix) at the following locations.
- C:\docker
- C:\ProgramData\docker
- C:\Program Files\docker
- C:\Users\{your-user}\.docker
- Uninstall ‘Docker Desktop’ from your machine
Once this clean-up is done, we will be ready to set up the Docker Engine. (I am going to share a PowerShell script at the end to automatically execute all these steps)-
-
Setup Docker Engine
- You need to download latest Docker Engine binary from here.
- Extract it and register Docker Daemon as a Windows Service with this command
- dockerd –register-service
- Add this path in Environment Variables
- This bridges a gap between OS and Docker Daemon. Now you can run commands anywhere in your machine.
- Test command – docker version
Your Docker Engine should be setup now. (Since we are focusing on Sitecore, we will setup Engine to support only Windows containers)
-
Install Docker Compose Plugin
-
Set Rights for Current user
- This can be an optional step if the logged-in user has Admin Rights. Personally, I did this to rule out any future rights-related issues.
Once this is all done, there is no harm to restart 😉 And finally, you should be ready to spin up containers. This is a link to scripts.
But wait, it’s not over yet. I have a surprise for GUI lovers. You still have few alternatives,
- Use the Containers window in Visual Studio
- It provides you a handy way to monitor Containers in Visual Studio. Check more details here
- It is available in Visual Studio 2022 or Visual Studio 2019 version 16.4 or later
- Make sure to run VS as admin, otherwise, you may see this error – Docker Desktop is not running. Please start Docker Desktop and try again.
- Docker in Visual Studio Code
- A very similar extension for VS Code from Microsoft. Check more details here
I am working on compiling the below information. Stay tuned!
- Troubleshooting guide for bugs faced while setting up Docker Engine
- Docker Engine update scripts
That’s all for now! You are all set to work on your containerized Sitecore solution without Docker Desktop now.