Skip to content

Instantly share code, notes, and snippets.

@skyend
Created July 11, 2014 14:49
Show Gist options
  • Save skyend/cfc26761ebb3a357cbe9 to your computer and use it in GitHub Desktop.
Save skyend/cfc26761ebb3a357cbe9 to your computer and use it in GitHub Desktop.
docker service script for systemd
[Unit]
Description=Docker Mongodb image
After=mongo.service
[Service]
ExecStart=/bin/bash -c '/usr/bin/docker run -v /data/mongo:/data/mongo --name mongo -p 27017:27017 oym:mongo'
ExecStop=/bin/bash -c '/usr/bin/docker stop mongo && /usr/bin/docker rm mongo'
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment