title: How to run container in a remote docker host with Jenkins
body: <p>I have two servers: </p>
  
  <ul>
  <li>Server A: Build server with Jenkins and Docker installed.</li>
  <li>Server B: Production server with Docker installed.</li>
  </ul>
  
  <p>I want to build a Docker image in Server A, and then run the corresponding container in Server B. The question is then:</p>
  
  <p><strong>What's the recommended way of running a container in Server B from Server A, once Jenkins is done with the docker build? Do I have to push the image to Docker hub to pull it in Server B, or can I somehow transfer the image directly?</strong></p>
  
  <p>I'm really not looking for specific Jenkins plugins or stuff, but rather, from a security and architecture standpoint, what's the best approach to accomplish this?</p>
  
  <p>I've read a ton of posts and SO answers about this and have come to realize that there are plenty of ways to do it, but I'm still unsure what's the ultimate, most common way to do this. I've seen these alternatives:</p>
  
  <ul>
  <li>Using <code>docker-machine</code></li>
  <li>Using Docker Restful Remote API</li>
  <li>Using plain <code>ssh root@server.b "docker run ..."</code></li>
  <li>Using Docker Swarm (I'm super noob so I'm still unsure if this is even an option for my use case)</li>
  </ul>
  
  <p>Edit:</p>
  
  <p>I run Servers A and B in Digital Ocean.</p>