Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to publish from sbt-native-packager to Google Container Engine?

I am experimenting with dockerizing my Scala/Akka app: I'm using sbt-native-packager and would like to deploy to GKE. It seems I could do that by setting the right values in my build.sbt file and then launch it via sbt docker:publish.

I am not sure what the values should be in the build.sbt file. For instance, the dockerRepository setting should have the form

[repository.host[:repository.port]]

What would be the right information to put there for a cluster on GKE? Thank you very much for any pointer.

like image 833
ticofab Avatar asked Oct 18 '22 08:10

ticofab


1 Answers

The following build.sbt settings worked for me:

dockerBaseImage := "java:8-jre"
packageName in Docker := "you-gcloud-project-id/api"
maintainer in Docker := "Maintainer"
packageSummary := "Package summary"
packageDescription := "Package description"
dockerRepository := Some("us.gcr.io")

Steps

  1. Substitute your Google Cloud Project ID in the packageName field

  2. Set dockerRepository to whichever gcr.io host you want to use.

  3. Authenticate using the Google Cloud SDK

  4. Run sbt docker:publish

like image 75
Jason Avatar answered Oct 28 '22 20:10

Jason