Thursday, August 24, 2017

Installing Docker on an Ubuntu AWS EC2 machine

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 \
    software-properties-common

# For "sudo: unable to resolve host ip-x-x-x-x" errors, follow the following link to set "DNS Hostnames" to True:
# http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html#vpc-dns-updating
sudo true

# Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# Verify that the key fingerprint is 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88.
sudo apt-key fingerprint 0EBFCD88

# Use the following command to set up the stable repository.
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

# Install the latest version of Docker CE
sudo apt-get update
sudo apt-get install docker-ce
sudo docker run hello-world

# Ref: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository

No comments:

Post a Comment