Skip to content

Instantly share code, notes, and snippets.

@petems
Created March 9, 2016 15:55
Show Gist options
  • Save petems/338dbd8bfd6bc07582b9 to your computer and use it in GitHub Desktop.
Save petems/338dbd8bfd6bc07582b9 to your computer and use it in GitHub Desktop.
docker service
#!/bin/bash
#
# /etc/rc.d/init.d/<servicename>
#
# <description of the *service*>
# <any general comments about this init script>
#
# <tags -- see below for tag definitions. *Every line* from the top
# of the file to the end of the tags section must begin with a #
# character. After the tags section, there should be a blank line.
# This keeps normal comments in the rest of the file from being
# mistaken for tags, should they happen to fit the pattern.>
# Source function library.
. /etc/init.d/functions
start() {
/usr/bin/docker daemon \
-H unix:///var/run/docker-bootstrap.sock \
-p /var/run/docker-bootstrap.pid \
--iptables=false \
--ip-masq=false \
--bridge=none \
--graph=/var/lib/docker-bootstrap
}
case "$1" in
start)
start
;;
stop)
echo "Not yet"
;;
status)
echo "Not yet"
;;
restart)
echo "Not yet"
;;
*)
echo "Usage: <servicename> {start|stop|status|restart"
exit 1
;;
esac
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment