Getting Started

Docker Community Edition (CE) (Docker CE) is the version we are using.

Install

Tip

If you are using the Docker files created by Django CookieCutter, then the version from the Ubuntu repositories is not new enough, so it is better to follow the official instructions to install Docker: https://docs.docker.com/engine/installation/linux/ubuntu/

Note

docker-compose is installed using pip! Add docker-compose to requirements/local.txt.

Ubuntu 16.10

Note

See tip above…

sudo apt install docker.io

Ubuntu 16.04

Important

Make sure you have Ubuntu 14.04 (64 bit)

Important

Install Docker on a 64 bit operating system.

Remove old versions:

sudo apt-get remove docker docker-engine

Verify that you have wget installed:

which wget

Install Docker:

wget -qO- https://get.docker.com/ | sh

Configure

If you would like to use Docker as a non-root user, you should now consider adding your user to the docker group with something like:

sudo usermod -aG docker patrick

Note

Log out and back in again.

Verify docker is installed correctly:

docker run hello-world

Docker uses a bridge to manage containers networking, by default UFW drops all forwarding, a first step is to enable forwarding:

sudo vim /etc/default/ufw
# Change:
# DEFAULT_FORWARD_POLICY="DROP"
# to
DEFAULT_FORWARD_POLICY="ACCEPT"

Then reload UFW:

sudo ufw reload

Install Docker Compose:

sudo -i
curl -L https://github.com/docker/compose/releases/download/1.3.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

Note

This looks like a very useful starting point: https://docs.docker.com/compose/django/