Skip to content

Instantly share code, notes, and snippets.

@zlocate
Created July 19, 2020 10:27
Show Gist options
  • Save zlocate/fcf4116763525c23512a3944e62f2643 to your computer and use it in GitHub Desktop.
Save zlocate/fcf4116763525c23512a3944e62f2643 to your computer and use it in GitHub Desktop.
Install Docker-ce on Ubuntu\Debian-like distro
#!/bin/bash
INSTALL_PACKAGES="docker-ce docker-ce-cli containerd.io"
REMOVE_PACKAGES="docker docker-engine docker.io containerd runc"
# Clean up installed packages
sudo apt-get remove "$REMOVE_PACKAGES"
# Install dependencies
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
# Installing apt repository key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
# Add docker repo
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
sudo apt-get update
# Install docker and misc
sudo apt-get install -y "$INSTALL_PACKAGES"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment