Skip to content

Instantly share code, notes, and snippets.

@marcio-azevedo
Last active December 31, 2016 12:03
Show Gist options
  • Save marcio-azevedo/1454d0e1f3cf74c755419423ae0cdfd4 to your computer and use it in GitHub Desktop.
Save marcio-azevedo/1454d0e1f3cf74c755419423ae0cdfd4 to your computer and use it in GitHub Desktop.
Docker Commands Cheat Sheet for Ubuntu Xenial 16.04 (LTS)
# Install Docker on Ubuntu Xenial 16.04 (LTS)
# based on https://docs.docker.com/engine/installation/linux/ubuntulinux/
# Prerequisites
# make sure Kernel version is (at least) 3.10
# $ uname -r
# Update your apt sources
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
# for Ubuntu Xenial 16.04 (LTS)
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
# pick one from $ apt-cache policy docker-engine
apt-cache policy docker-engine
sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
# -------------- #
# Install docker #
# -------------- #
sudo apt-get update
sudo apt-get install docker-engine
# run docker
sudo service docker start
# This command downloads a test image and runs it in a container. When the container runs, it prints an informational message. Then, it exits.
sudo docker run hello-world
# update
sudo apt-get upgrade docker-engine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment