Skip to content

Instantly share code, notes, and snippets.

@lopezjurip
Last active Oct 25, 2015
Embed
What would you like to do?
Docker on Ubuntu

Prepare Ubuntu server for Docker

Lets start up-to-date everything:

sudo apt-get update; sudo apt-get upgrade -y; sudo apt-get dist-upgrade -y

Update your apt sources

apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

See Ubuntu version:

lsb_release -a

Edit sources:

sudo nano /etc/apt/sources.list.d/docker.list

Paste depending on your version:

# Ubuntu Precise
deb https://apt.dockerproject.org/repo ubuntu-precise main
# Ubuntu Trusty
deb https://apt.dockerproject.org/repo ubuntu-trusty main
# Ubuntu Vivid
deb https://apt.dockerproject.org/repo ubuntu-vivid main
# Ubuntu Wily
deb https://apt.dockerproject.org/repo ubuntu-wily main

Finish with CTRL+X -> Y

Install

Install everything and reboot the machine:

sudo apt-get update
sudo apt-get purge lxc-docker*
sudo apt-cache policy docker-engine
sudo apt-get update
sudo apt-get install linux-image-generic-lts-trusty -y
sudo reboot

After reboot:

sudo apt-get update
sudo apt-get install docker-engine -y

Docker Compose

sudo apt-get -y install python-pip
sudo pip install -U docker-compose

Clean

Free space:

sudo apt-get clean
sudo apt-get autoremove -y
sudo apt-get autoclean

sudo no more

Edit group, you must log out:

# Replace 'USER' with your current session
sudo usermod -aG docker USER
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment