Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Linux (Ubuntu) Docker/Docker-Compose Install Script
echo "Starting docker community edition install..."
echo "Removing any old instances of docker and installing dependencies"
apt remove -y docker docker-engine containerd runc
apt update
apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
echo "Dowloading latest docker and adding official GPG key"
curl -fsSL | apt-key add -
echo "Pulling the latest repository"
add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
apt update
echo "Installing docker community edition"
apt install -y docker-ce docker-ce-cli
echo "Docker install completed, installing docker-compose"
echo "Dowloading docker-compose 1.25.5 - be sure to update to the latest stable"
curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
echo "Setting binary permissions"
chmod +x /usr/local/bin/docker-compose
echo “Docker and docker-compose install complete”
# Run docker as non-root user on Ubuntu
sudo usermod -aG docker $USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment