Skip to content

Instantly share code, notes, and snippets.

@otiai10
Created March 20, 2019 07:28
Show Gist options
  • Save otiai10/c65532f2f5e9a11e7ccc5f5272741caa to your computer and use it in GitHub Desktop.
Save otiai10/c65532f2f5e9a11e7ccc5f5272741caa to your computer and use it in GitHub Desktop.
/usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket
[Service]
Type=notify
EnvironmentFile=-/etc/default/docker
# 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
ExecStartPre=/bin/sh -x -c "if [ ! -s /var/lib/docker/repositories-overlay ]; then rm -f /var/lib/docker/repositories-overlay; fi"
ExecStart=/usr/bin/docker daemon -s overlay --registry-mirror=https://mirror.gcr.io --host=fd:// $DOCKER_OPTS
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
[Install]
WantedBy=multi-user.target
@krishnarmrk
Copy link

May i know use of this file...

@otiai10
Copy link
Author

otiai10 commented Aug 22, 2019

actually I don't remember why I made it.
seems I was trying to setup docker daemon on a cloud instance, and this was a memo of the config inside Container Optimized Machine of Google Cloud.

not sure what you're trying but that's all I can say now 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment