Difference between revisions of "Docker"

From Jon's Wiki
(Created page with "Install docker:<ref>Docker online documentation: [http://docs.docker.com/installation/ubuntulinux/ "installation on Ubuntu"]</ref> apt-key adv --keyserver hkp://pgp.mit.edu:...")
 
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
  
 
  apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 2C52609D
 
  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
+
  echo 'deb <nowiki>https://apt.dockerproject.org/repo</nowiki> ubuntu-trusty main' >> /etc/sources.list.d/docker.list
 
  apt-get update
 
  apt-get update
 
  apt-get install docker-engine
 
  apt-get install docker-engine
Line 13: Line 13:
 
In <tt>/etc/default/docker.io</tt> add your settings:
 
In <tt>/etc/default/docker.io</tt> add your settings:
  
  DOCKER_OPTS="--dns 192.168.''your.dns'' --bip=''169.254.0.1/16"
+
  DOCKER_OPTS="--dns 192.168.''your.dns'' --bip=''169.254.0.1''/16"
  
 
If you're using systemd, these need to go in <tt>/etc/systemd/system/docker.service.d/docker.conf</tt> instead:
 
If you're using systemd, these need to go in <tt>/etc/systemd/system/docker.service.d/docker.conf</tt> instead:
Line 36: Line 36:
 
== Notes ==
 
== Notes ==
  
{{references}}
+
<references/>

Latest revision as of 01:15, 27 October 2015

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"