title: Docker and systemd - service stopping after 10 seconds
body: <p>I'm having trouble getting a Docker container to stay up when it's started by systemd. When I start it manually with <code>sudo docker start containername</code>, it stays up without trouble, but when it's started via systemd with <code>sudo systemctl start containername</code>, it stays up for 10 seconds then mysteriously dies, leaving messages in syslog something like the following:</p>
  
  <pre><code>Mar 13 14:01:09 hostname docker[329]: time="2015-03-13T14:01:09Z" level="info" msg="POST /v1.17/containers/containername/stop?t=10"
  Mar 13 14:01:09 hostname docker[329]: time="2015-03-13T14:01:09Z" level="info" msg="+job stop(containername)"
  </code></pre>
  
  <p>I am making the assumption that it's systemd killing the process, but I can't work out why it might be happening. The systemd unit file (/etc/systemd/system/containername.service) is pretty simple, as follows:</p>
  
  <pre><code>[Unit]
  Description=MyContainer
  After=docker.service
  Requires=docker.service
  
  [Service]
  ExecStart=/usr/bin/docker start containername
  ExecStop=/usr/bin/docker stop containername
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>Docker starts fine on boot, and it looks like it does even start the docker container, but no matter if on boot or manually, it then quits after exactly 10 seconds. Help gratefully received!</p>