Skip to content

Instantly share code, notes, and snippets.

@scottslowe
Created August 19, 2014 16:57
Show Gist options
  • Save scottslowe/a0777d789d91464441fd to your computer and use it in GitHub Desktop.
Save scottslowe/a0777d789d91464441fd to your computer and use it in GitHub Desktop.
This very simple systemd unit file will launch a Docker container running the Nginx web server.
[Unit]
Description=Nginx web front-end
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=/usr/bin/docker pull nginx
ExecStart=/usr/bin/docker run --rm --name nginx -p 80:80 nginx
ExecStop=/usr/bin/docker stop nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment