2013-10-15 15:37:18 +00:00
|
|
|
[Unit]
|
2014-01-09 17:09:25 +00:00
|
|
|
Description=Docker Application Container Engine
|
2015-06-08 10:14:35 +00:00
|
|
|
Documentation=https://docs.docker.com
|
2014-07-26 14:41:50 +00:00
|
|
|
After=network.target docker.socket
|
2014-07-14 23:07:40 +00:00
|
|
|
Requires=docker.socket
|
2013-10-15 15:37:18 +00:00
|
|
|
|
|
|
|
[Service]
|
2014-07-14 22:39:42 +00:00
|
|
|
ExecStart=/usr/bin/docker -d -H fd://
|
2015-01-20 19:22:04 +00:00
|
|
|
MountFlags=slave
|
2014-03-04 17:54:53 +00:00
|
|
|
LimitNOFILE=1048576
|
|
|
|
LimitNPROC=1048576
|
2015-02-09 19:03:07 +00:00
|
|
|
LimitCORE=infinity
|
2013-10-15 15:37:18 +00:00
|
|
|
|
|
|
|
[Install]
|
Fix system socket/service unit files
Two problems how they are today:
In the current systemd unit files it is impossible to have the
docker.service started at system boot. Instead enableing docker.service
will actually enable docker.socket. This is a problem, as that means
any container with --restart=always will not launch on reboot. And of
course as soon as you log in and type docker ps, docker.service will be
launched and now your images are running. Talk about a PITA to debug!
The fix is to just install docker.service when people ask docker.service
to be enabled. If an admin wants to enable docker.socket instead, that
is fine and will work just as it does today.
The second problem is a common docker devel workflow, although not
something normal admins would hit. In this case consider a dev doing
the following:
systemctl stop docker.service
docker -d
[run commands]
[^C]
systemctl start docker.service
Running docker -d (without -F fd://) will clean up the
/var/run/docker.sock when it exits. Remember, you just ran the docker
daemon not telling it about socket actviation, so cleaning up its socket
makes sense! The new docker, started by systemd will expect socket
activation, but the last one cleaned up the docker.sock. So things are
just broken. You can, today, work around this by restarting
docker.socket. This fixes it by telling docker.socket that it is
PartOf=docker.service. So when docker.service is
started/stopped/restarted docker.socket will also be
started/stopped/restarted. So the above semi-common devel workflow will
be fine. When docker.service is stopped, so is docker.socket, docker
-d (without -F fd://) will create and delete /var/run/docker.sock.
Starting docker.service again will restart docker.socket, which will
create the file an all is happy in the word.
Signed-off-by: Eric Paris <eparis@redhat.com>
2014-10-07 18:09:08 +00:00
|
|
|
WantedBy=multi-user.target
|