title: How do get GoCD server to run persistently in Docker to run in a VM?
body: <p>I am trying to run GoCD server in Docker in a VM. To test the setup I created an Ubuntu 14.04 server in VirtualBox, installed Docker, and then following instructions from </p>
  
  <p><a href="https://github.com/gocd/gocd-docker" rel="nofollow">https://github.com/gocd/gocd-docker</a> &amp; <a href="https://hub.docker.com/r/gocd/gocd-server/" rel="nofollow">https://hub.docker.com/r/gocd/gocd-server/</a> I ran:
  <code>docker run -tiP gocd/gocd-server</code></p>
  
  <p>This works, but the problem is that if I close the terminal (which I'll have to do in production because I cannot keep an SSH terminal open indefinitely) the server dies. I was able to get the port this server was running on by opening another terminal to the VM and running docker PS. I was able to access that one from my browser. Of course I need a solution that allows me to close the terminal. </p>
  
  <p>So I tried it again (in a fresh VM), hit Ctrl+C, waited for it to shut down, then ran:</p>
  
  <p><code>docker rename randomDockerName gocd-server</code></p>
  
  <p>and then </p>
  
  <p><code>docker start gocd-server</code>
  <code>docker ps</code></p>
  
  <p>I then see something like</p>
  
  <p><code>randomLetters        gocd/gocd-server    "/sbin/my_init"     25 minutes ago      Up 10 minutes       0.0.0.0:32773-&gt;8153/tcp, 0.0.0.0:32772-&gt;8154/tcp  gocd-server</code></p>
  
  <p>So I point my chrome on my Ubuntu 14.04 host machine to ipaddress:32773 and I get nothing. Now when the docker image was running with docker run this worked just fine, so why isn't this working with docker start? I can't use run again because that creates a new docker image and I have to keep the terminal open to keep the server running.</p>
  
  <p>So my question is, how do I run GoCD in Docker on a VM without having to stay logged in to that VM?</p>
  
  <p>Also, the Ubuntu VM is configured in VirtualBox with both a NAT and a Bridged network card.</p>