title: Starting a Docker container with a user different from the one on the host
body: <p>I am trying to deploy an image on a Ubuntu server. The problem is I would like the container to have a user other than root. In other words, I would like to start the container under that user. </p>
  
  <p>What I have tried.
  I have successfully created a user in my container which has an image.
  I tried to start the container with the docker start command which was unsuccessful.</p>
  
  <p>I tried to create a new container with a user defined inside the dockerfile, it was also unsuccessful.</p>
  
  <pre><code>root@juju_dev_server:/home/dev# sudo docker run -it --user dev d08d53c4d78b
  docker: Error response from daemon: linux spec user: unable to find user dev: no matching entries in passwd file
  </code></pre>
  
  <p>.</p>
  
  <p>Here is my dockerfile</p>
  
  <pre><code> FROM debian
  
  RUN groupadd -g 61000 dev
  RUN useradd -g 61000 -l -m -s /bin/false -u 61000 dev
  USER dev
  
  CMD ["bash"]
  
  
  
  FROM java:8
  EXPOSE 8080
  ADD /target/juju-0.0.1.jar juju-0.0.1.jar
  ENTRYPOINT ["java","-jar","juju-0.0.1.jar"]
  </code></pre>