Skip to content

Instantly share code, notes, and snippets.

@cezarsa
Last active August 29, 2015 14:10
Show Gist options
  • Save cezarsa/0846ba2a8b229cd01833 to your computer and use it in GitHub Desktop.
Save cezarsa/0846ba2a8b229cd01833 to your computer and use it in GitHub Desktop.
#!/bin/bash
cat<<-EOF > /etc/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
Requires=docker.socket
[Service]
Environment="TMPDIR=/var/tmp/"
ExecStartPre=/bin/mount --make-rprivate /
LimitNOFILE=1048576
LimitNPROC=1048576
# Run docker but don't have docker automatically restart
# containers. This is a job for systemd and unit files.
ExecStart=/usr/bin/docker --daemon --storage-driver=btrfs --host=fd:// --host=0.0.0.0:4243
[Install]
WantedBy=multi-user.target
EOF
systemctl stop docker
systemctl disable docker
systemctl enable /etc/systemd/system/docker.service
systemctl start docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment