You may want to check out the step before this, Building a Linux Open-Source GIS Environment with Windows: Part 1 - WSL!
Installing Docker and Docker-Compose
Docker lets you run containers on your computer (or Subsystem in this case).
Docker-compose is a simple Docker orchestrator that’s great for small systems.
- Docker and digitalocean have put together some great information on this, and I could never do better, so I used their documents to put together a script:
- https://docs.docker.com/engine/install/ubuntu/
- https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04
- You can paste this into Terminal
export user=$(whoami)
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update && sudo apt-get install \
docker-ce \
docker-ce-cli \
containerd.io
sudo usermod -aG docker ${USER}
# This step will ask you for your password again
su - ${USER}
# start docker (This is needed with WSL)
sudo service docker start
# exit out of the su command
exit
- Let’s install docker-compose
- Get the latest version number of Docker Compose
export DOCKERCOMPOSEVERSION=$(curl -s https://github.com/docker/compose/releases/latest | perl -pe 's/^.+\/tag\/(.+?)">.+/\1/g')
- Install the latest docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/${DOCKERCOMPOSEVERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \ sudo chmod +x /usr/local/bin/docker-compose
- Verify your version by running this command
docker-compose --version
- You now have Docker and docker-compose installed!