Skip to content

Instantly share code, notes, and snippets.

@sigismund
Last active June 14, 2022 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sigismund/b5b79633e41206ec1e21e9d1cf4ce7e6 to your computer and use it in GitHub Desktop.
Save sigismund/b5b79633e41206ec1e21e9d1cf4ce7e6 to your computer and use it in GitHub Desktop.
Install latest docker and docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
DOCKER_COMPOSE_VERSION="2.6.0"
# Alternatively you can use the official docker install script
wget -qO- https://get.docker.com/ | sh
# Install docker-compose
sudo sh -c "curl -L "https://github.com/docker/compose/releases/download/v2.6.0/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose > /etc/bash_completion.d/docker-compose"
sudo chmod +x /usr/local/bin/docker-compose
sudo sh -c "curl -L https://raw.githubusercontent.com/docker/compose/$DOCKER_COMPOSE_VERSION/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"
# Add user to docker group
sudo usermod -aG docker $USER
newgrp docker
echo "Relogin/restart if you can't connect to docker socket."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment