Docker

From Jon's Wiki
Revision as of 01:15, 27 October 2015 by Johnno (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Install docker:[1]

apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 2C52609D
echo 'deb https://apt.dockerproject.org/repo ubuntu-trusty main' >> /etc/sources.list.d/docker.list
apt-get update
apt-get install docker-engine

Issues

  • DNS inside containers may have 4.4.4.4 and 8.8.8.8 hard coded, so they won't see your local LAN.
  • Docker creates a network interface on 172.17.0.0/16, which may conflict with VPNs and/or Vagrant, LXC, etc.

In /etc/default/docker.io add your settings:

DOCKER_OPTS="--dns 192.168.your.dns --bip=169.254.0.1/16"

If you're using systemd, these need to go in /etc/systemd/system/docker.service.d/docker.conf instead:

[Service]
ExecStart=
ExecStart=/usr/bin/docker -d -H fd:// --dns 192.168.your.dns --bip=169.254.0.1/16

You may also need this on there as well:

--fixed-cidr=169.254.0.0/16

Restarting docker won't pick these changes up - you need to blow away the interface and whatnot as well:

systemctl daemon-reload
systemctl stop docker
ip link set docker0 down
brctl delbr docker0
iptables -t nat -F
systemctl start docker

Notes

  1. Docker online documentation: "installation on Ubuntu"