Skip to content

Commit

Permalink
docker: add systemd service file
Browse files Browse the repository at this point in the history
Some options of docker.service are commented out, because they currently
don't work on our system (to old systemd).

We want to start docker only on demand.
  • Loading branch information
donald committed Oct 7, 2016
1 parent b9a71a0 commit e59da5b
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion docker.be0
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env beesh

# BEE_VERSION docker-1.12.1-0.bee
# BEE_VERSION docker-1.12.1-1.bee

# NOTE: We require a running docker environment. For the first bootstrap
# this can be provided by the package docker_binary
Expand Down Expand Up @@ -69,6 +69,7 @@ mee_build() {
mee_install() {
install --directory $D$BINDIR
install --directory $D$SYSCONFDIR/default
install --directory $D$SYSCONFDIR/systemd/system

V=$PKGVERSION

Expand All @@ -90,6 +91,38 @@ mee_install() {
cat >$D$SYSCONFDIR/default/docker <<-'__EOF__'
DOCKER_OPTS="--storage-driver=overlay2"
__EOF__

cat >$D$SYSCONFDIR/systemd/system/docker.service <<-'__EOF__'
[Unit]
Description=Docker Application Container Engine
#Documentation=https://docs.docker.com
After=network.target

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
#LimitNOFILE=infinity
#LimitNPROC=infinity
#LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
#TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
#Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
StandardOutput=syslog

[Install]
#WantedBy=multi-user.target
__EOF__
}

## by default this may be 'make install DESTDIR="${D}"'
Expand Down

0 comments on commit e59da5b

Please sign in to comment.