-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure dockerPush to use a private registry instead of docker.io #53
Comments
I want to more about the use case for this. |
We create multiple images but only some are pushed to the an open registry(lets say docker.io). But each image can/should be pushed to a local private registry. The main difference between naming in the two is that, in the local registry we have detailed versions (dirty versions with hashes), whereas in the global one the versions are simplified. |
If there is interest from others on a feature to support this then we could perhaps add it. |
+1 |
Probably too late, but +1 |
+1 as well |
After re-reading this I'm unsure if this is a problem. It might be as easy to just set the exact names you want the image to be tagged with in the key If you want completely custom behavior you can create your own sbt task which can push whatever you want it to push: import sbtdocker._
val customDockerPush = taskKey[Unit]("My custom docker push task")
customDockerPush := {
val log = Keys.streams.value.log
val dockerPath = (DockerKeys.dockerPath in docker).value
val imageNames = Seq(ImageName("my-org/my-fancy-image:verion"))
DockerPush(dockerPath, imageNames, log)
} and then just call it |
Currently to push to a private repository, I append the registry in frontend of the images name like:
myregistry/project1/target1:version. It will be useful to have an option to configure the registry to push to (that is appended in front of the name at time of push).
This problem could also be solved by allowing multiple tags based upon some settings( for example registry ) and allowing to push only the selected tag(s). For example:
ImageName("localRegistry",s"$dockerRegistry/$project/$name:v${version.value}"),
ImageName("default",s"$project/$name:v${version.value}")
and then allowing
sbt target/dockerBuildAndPush localRegistry
The text was updated successfully, but these errors were encountered: