Docker Installation
If you have an old docker installation, you may need to remove it before installing the Docker CE
distribution. This is especially true if you have an older Docker for Windows installation.
The section below describes how to remove an existing Docker installation.
Following that section, you will find instructions on how to install Docker CE on a Windows Server 2022 or 2025 machine.
Removing an Existing Docker Installation
If Docker, for whatever reason, is already installed and it isn’t the Docker CE distribution these are the steps to uninstall Docker:
-
Make sure the current installation not is running any containers that need to be preserved.
-
Delete all running containers:
docker rm $(docker ps -aq) --force -
Delete all images:
docker rmi $(docker images -aq) --force -
Stop Docker service:
Stop-Service docker -
Delete the Docker data folder located at
C:/programData/docker. If this cannot be deleted it’s most likely because of Docker service still running or linking files in windowsfilter sub-directory, in that case follow this guide to delete it with docker-ci-zap. Docker-ci-zap would be used like this:.\docker-ci-zap.exe -folder "C:\ProgramData\docker"The Docker service must also be removed, this can be done with:
sc.exe delete docker
Docker Installation
Docker, Docker Compose and the scripts for installing them are supplied by MOPSsys, the files required are included in the redist folder and are version specific:
- Install-Docker.ps1
- install-docker-ce.ps1
- docker-<version>.zip
- docker-compose.exe
Installing is simple and requires no configuration:
- Move all the files above to the same directory
- Run
Install-Docker.ps1in an elevated Powershell
Switching Docker data drive
Docker container data is stored in the C:\ProgramData\docker directory by default. You should
switch this to a drive other than the system drive since Windows docker container images consumes
rather large amounts of disk space.
To switch Docker data drive from default C volume to for example E, add the following to
C:/programData/docker/config/daemon.json:
{
"data-root": "E:/docker"
}
After this Docker must be restarted:
Restart-Service docker
You have now completed the Docker installation and can proceed with installing MOPS 4.0.