Skip to content

Instantly share code, notes, and snippets.

@evansmwendwa
Created January 1, 2019 17:28
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 evansmwendwa/e3d66aa64db6455e69ae0af0c1b511c4 to your computer and use it in GitHub Desktop.
Save evansmwendwa/e3d66aa64db6455e69ae0af0c1b511c4 to your computer and use it in GitHub Desktop.

Docker installation on Ubuntu

Uninstall old versions

sudo apt-get remove docker docker-engine docker.io

Update the apt package index:

sudo apt-get update

Install packages to allow apt to use a repository over HTTPS:

sudo apt-get install \
     apt-transport-https \
     ca-certificates \
     curl \
     gnupg2 \
     software-properties-common
     

Add Docker’s official GPG key:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

Verify Key Fingerprint

sudo apt-key fingerprint 0EBFCD88

Add apt repository

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/debian \
   $(lsb_release -cs) \
   stable"
 
sudo apt-get update

Install Docker CE

sudo apt-get install docker-ce

Verify docker installation

sudo docker run hello-world

Install Docker Compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Make docker compose executable

sudo chmod +x /usr/local/bin/docker-compose

Test installation

docker-compose --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment