Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chrimaho/bcbe79f2f8d0f400acadef43c08575bf to your computer and use it in GitHub Desktop.
Save chrimaho/bcbe79f2f8d0f400acadef43c08575bf to your computer and use it in GitHub Desktop.
# Uninstall old versions
sudo apt-get remove docker docker-engine docker.io containerd runc
# Update the package index
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
# Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Set up the stable repository
echo \
"deb [arch=$(dpkg --print-architecture) 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
# Install Docker Engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
# Verify that Docker Engine is installed correctly
sudo docker run hello-world
# Download the stable release of Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# Apply executable permissions to the binary
sudo chmod +x /usr/local/bin/docker-compose
# Test the installation
docker-compose --version
# Update user so docker can run without needing the sudo command
sudo groupadd docker
sudo usermod -aG docker $USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment