title: build a docker image for Rest API built with Scala Play
body: <p>I am trying to dockerize the Rest API built with Scala Play so I can use  AWS EC2 or Kubernetes to deploy it.</p>
  
  <p>Following this:
  :
  <a href="https://guilhebl.github.io/scala/backend/docker/play/2017/08/23/scala-play-docker-sbt-native-packager-example/" rel="nofollow noreferrer">https://guilhebl.github.io/scala/backend/docker/play/2017/08/23/scala-play-docker-sbt-native-packager-example/</a> and 
  it failed using this sequence of command:</p>
  
  <pre><code>sbt playGenerateSecret
  sbt dist
  sbt docker:publishLocal
  docker run -p 9000:9000 -e APPLICATION_SECRET="token from above"  play-scala-rest-api-example:1.0-SNAPSHOT
  
  </code></pre>
  
  <p>with this official example app:</p>
  
  <p><a href="https://github.com/playframework/play-samples/tree/2.8.x/play-scala-rest-api-example" rel="nofollow noreferrer">https://github.com/playframework/play-samples/tree/2.8.x/play-scala-rest-api-example</a></p>
  
  <p>Other teams need a <code>Dockerfile</code> to deploy the app to AWS EC2 with Jenkins. Right now it seems like  a <code>Dockerfile</code> is not generated until <code>sbt docker:publishLocal</code></p>
  
  <p>It would be better if we can find some official tutorials showing how to do this. </p>