Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env sh
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Post installation
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker $USER
# Logout and login, even reboot
#!/usr/bin/env sh
set -e
sudo rm -f /etc/apt/sources.list.d/docker.list
sudo apt update -y
# Install dependencies.
sudo apt install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
# Install docker
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
echo "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" | \
sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update -y
sudo apt install -y docker-ce docker-ce-cli containerd.io
# Run docker
sudo systemctl start docker
sudo systemctl enable docker
# Add user to docker group for using docker without sudo command.
sudo gpasswd -a "${USER}" docker
# Install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Post installation
sudo usermod -aG docker $USER
# Logout and login, even reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment