Skip to content

Instantly share code, notes, and snippets.

@richardjortega
Last active September 5, 2019 01:34
Show Gist options
  • Save richardjortega/e5f6d9fdc25d15b633a4970edc5f13d0 to your computer and use it in GitHub Desktop.
Save richardjortega/e5f6d9fdc25d15b633a4970edc5f13d0 to your computer and use it in GitHub Desktop.
Install Docker CE on Ubuntu 18.04 (run as root)
# Run as root, sets up stable version of Docker CE
# Bash version of : https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-engine---community-1
# Quickly run script via: curl <gist raw link> | bash
# Update apt package index
apt-get update -y
# Install packages to allow apt to use a repository over HTTPS
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
# Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Verify that you now have the key with the fingerprint
apt-key fingerprint 0EBFCD88
# Add stable repository
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# Update the apt package index
apt-get update
# Install the latest version of Docker Engine - Community and containerd
apt-get install -y docker-ce docker-ce-cli containerd.io
# Verify that Docker Engine - Community is installed correctly by running the hello-world image
docker run hello-world
# Print Docker version
docker --version
# Install docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# Print docker-compose vesion
docker-compose --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment