4

I am Using SBT Native Packager to build Docker Image, and my build.sbt is :

   packageName in Docker := name.value
   version in Docker := version.value
   dockerBaseImage := "java"
   dockerRepository :=Some("index.docker.io/xyz")
   dockerExposedPorts := Seq(8283)

I am trying to publish image to private docker hub,but its giving

[error] unauthorized: authentication required.

in build.sbt how can i specify hub userName and Password.

is there any other configuration that i am missing here.

cpawali
  • 268
  • 3
  • 12
  • According to the [documentation](http://www.scala-sbt.org/sbt-native-packager/formats/docker.html#requirements), `It is currently not possible to provide authentication for Docker repositories from within the build.` – Abanoub Aug 25 '16 at 11:35

1 Answers1

1

Just like Abanoub said this isn't possible via configuration. But you should be able to make the build work by executing docker login in your shell and the packager should then work as expected.

Community
  • 1
  • 1
gesellix
  • 3,024
  • 28
  • 31