Created
March 7, 2021 15:19
-
-
Save guillemcanal/de95bf47664965ab7b9f33c51f312505 to your computer and use it in GitHub Desktop.
Ghetto dockerd startup script example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -e | |
main() { | |
case $1 in | |
start) | |
pgrep dockerd || sudo nohup /usr/bin/dockerd \ | |
--tlsverify \ | |
--tlscacert=/home/user/.docker/ca.pem \ | |
--tlscert=/home/user/.docker/server-cert.pem \ | |
--tlskey=/home/user/.docker/server-key.pem \ | |
--default-address-pool base=172.24.0.0/13,size=24 \ | |
-H unix:// \ | |
-H tcp://0.0.0.0:2376 > /dev/null 2>&1 & | |
;; | |
stop) | |
sudo pkill dockerd | |
;; | |
status) | |
pgrep dockerd &> /dev/null && echo 'running' || echo 'stopped' | |
;; | |
esac | |
} | |
main "${1:-"start"}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment