Install docker
Regardless of your operating system, docker requires linux to operate. When used on a different operating system, docker relies on virtual machines to build and run images.
There are two main types of docker installations:
- docker engine is the usual docker command line application
- docker desktop is a GUI app that also manages virtualization
Here’s what we suggest:
- If you’re on linux, install docker engine using your package manager
- If you’re on MacOS / Windows, install docker desktop if you are allowed to
- If you’re on windows and want to get docker running within WSL, or can’t use docker desktop, follow the docker on WSL tutorial
- If you’re on MacOS and can’t use docker desktop, follow the MacOS colima tutorial
Docker on WSL
This install option is very useful, as it allows having a perfectly normal linux install of docker engine inside WSL, which can still be reached from windows.
- Install WSL (If you had an old version of WSL, run
wsl --upgrade
) - Get an operating system image from the microsoft store (for example, debian or ubuntu)
- Enable systemd support within the WSL VM
- Follow the regular linux install tutorial for docker
- If you have docker desktop installed, you can configure it to use WSL
MacOS colima
This procedure allows installing docker without relying on docker desktop. It uses colima for virtualizing linux.
- Install homebrew
brew install docker docker-compose colima
- Install the compose plugin:
mkdir -p ~/.docker/cli-plugins && ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
- Configure colima:
- for apple silicon (M1/M2) macbooks:
colima start --cpu 2 --memory 6 --arch aarch64 --vm-type=vz --vz-rosetta --mount-type=virtiofs
- for small infrastructures:
colima start --cpu 2 --memory 4
- for big infrastructures:
colima start --cpu 2 --memory 6
brew services start colima
to automatically start colima on startup- Exit your terminal, open a new one
- You can now use docker CLI
If you’re using rancher desktop, please either:
- uninstall the application
- select
Manual
inPreferences
>Application
>Environement
colima delete
and try again (the disk format is not compatible). Settings will be lost.If you get this error: error getting credentials - err: exec: "docker-credential-osxkeychain": executable file not found in $PATH
Open ~/.docker/config.json
, and remove "credsStore": "osxkeychain"