I'm trying to publish a scala build to a docker registry with the following command :
./sbt "; set dockerRepository := Some(\"registryname/project\"); docker:publish"
I am specifying the dockerRepository but when running the command it is throwing the following error :
[error] You cannot push a "root" repository. Please rename your repository to <user>/<repo> (ex: <user>/example)
java.lang.RuntimeException: Repository for publishing is not specified.
[error] (all/*:publishConfiguration) Repository for publishing is not specified.
[error] (server/docker:publish) Nonzero exit value: 1
[error] (config/*:publishConfiguration) Repository for publishing is not specified.
[error] Total time: 63 s, completed 01/09/2015 10:48:04 AM
When I look at my local docker registry I can see it compiled the docker image but did not prefix the docker registry name :
docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
example 0.0.1 SNAPSHOT a6eb8942aa9f 8 minutes ago 1.136 GB
So it doesn't appear to be accepting the dockerRepository variable I am setting on the command, this is also in the build log :
[15:32:58][Step 4/5] [info] Loading project definition from /build/project
[15:33:01][Step 4/5] [info] Set current project to example (in build file:/build/)
[15:33:06][Step 4/5] [info] Defining {.}/*:dockerRepository
[15:33:06][Step 4/5] [info] The new value will be used by no settings or tasks.
[15:33:06][Step 4/5] [info] Reapplying settings...
From the comment of Alex Laverty:
In build.sbt:
dockerRepository in ThisBuild := Some("docker.io")
or in a project with submodules:
lazy val server = (project in file("server"))
.settings(dockerRepository := Some("docker.io"),
dockerUsername := Some("pame"),
...)
Then:
sbt docker:publish
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With