title: How to automate a docker run from a private Dockerhub repo?
body: <p>I have a EC2 server running Docker and I'd like to add the following to the <code>User Data</code> so my private Dockerhub images will be pulled/run when the server starts up, like so:</p>
  
  <pre><code>#!/bin/bash
  sudo docker run -p 3333:3333 -d --name Hello myusername/hello
  </code></pre>
  
  <p>But I'm unsure as to how to go about authenticating in order to gain access to the private repo <code>myusername/hello</code>.</p>
  
  <p>With Github you create and upload a deploy key, does Dockerhub offer a similar deploy key option?</p>