Skip to content

Instantly share code, notes, and snippets.

@spy86
Created March 31, 2020 17:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spy86/2a54b8734953662c38c72c10fb958295 to your computer and use it in GitHub Desktop.
Save spy86/2a54b8734953662c38c72c10fb958295 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -ex
systemctl stop docker
systemctl disable docker
echo "Copying scripts to /var/ssl/"
mkdir -p /var/ssl
cp ca.pem server-cert.pem server-key.pem /var/ssl/
cat<<-EOF > /etc/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
[Service]
ExecStartPre=/bin/mount --make-rprivate /
# Run docker but don't have docker automatically restart
# containers. This is a job for systemd and unit files.
ExecStart=/usr/bin/docker -d -s=btrfs -r=false --tlsverify --tlscacert=/var/ssl/ca.pem --tlscert=/var/ssl/server-cert.pem --tlskey=/var/ssl/server-key.pem -H fd:// -H 0.0.0.0:4243
#ExecStart=/usr/bin/docker -d -s=btrfs -r=false -H fd://
[Install]
WantedBy=multi-user.target
EOF
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