Skip to content

Instantly share code, notes, and snippets.

@eugeneware
Created August 4, 2013 05:18
Show Gist options
  • Save eugeneware/6149266 to your computer and use it in GitHub Desktop.
Save eugeneware/6149266 to your computer and use it in GitHub Desktop.
localhost units # ls -al
total 16
drwxr-xr-x 2 root root 4096 Aug 4 04:50 .
drwxr-xr-x 6 102 5000 4096 Aug 3 06:23 ..
-rw-r--r-- 1 root root 467 Aug 4 04:50 docker.service
-rw-r--r-- 1 root root 207 Aug 3 11:58 hello.service
localhost units # pwd
/media/state/units
localhost units # cat docker.service
[Service]
Type=simple
ExecStartPre=/bin/mount --make-rprivate /
# Enable forwarding to allow NAT to work
# TODO: Move this to sysctl.conf
ExecStartPre=/sbin/sysctl -w net.ipv4.ip_forward=1
# Try to use this alternate way of starting docker if docker crashes for you:
# ExecStart=/bin/bash -c "/usr/bin/nohup /usr/bin/docker -d -D &"
# You also need to update Type above to: Type=forking
ExecStart=/usr/bin/docker -d -D -r=true
[Install]
WantedBy=multi-user.target
localhost units # ps ax | grep docker
298 ? Ssl 0:00 /usr/bin/docker -d -D
483 ? Ssl 0:00 /usr/bin/docker run ubuntu /bin/sh -c while true; do echo Hello World; sleep 1; done
492 ? S 0:00 lxc-start -n 81f9ba7653adb2694ba1bb5c482e4d878e9c90f020ecad04fe4d3301499ffabc -f /var/lib/docker/containers/81f9ba7653adb2694ba1bb5c482e4d878e9c90f020ecad04fe4d3301499ffabc/config.lxc -- /sbin/init -g 172.16.42.1 -e HOME=/ -e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -- /bin/sh -c while true; do echo Hello World; sleep 1; done
1206 pts/1 S+ 0:00 grep --colour=auto docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment