-
Notifications
You must be signed in to change notification settings - Fork 446
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
Add: dockerAdditionalVersions #806
Conversation
Useful if you want other version tags added to Docker Image in addition to the project version. Examples include tagging by the git hash or git branch using the sbt-git plugin
Hi @dgilling, Thank you for your contribution! We really value the time you've taken to put this together. Before we proceed with reviewing this pull request, please sign the Typesafe Contributors License Agreement: |
Thanks for your pull request. Can you add documentation and tests for this feature? If I understand this correctly, this will publish multiple docker images with different versions in the form of
|
Yes that is correct. For my workflow, I use it in combination with sbt-git to add a docker tag that is the branch name. I will add some docs soon and get the paper signed. Derric
|
Hi. I had some time to read through the docker stuff and native-packagers implementation. dockerTarget <<= (dockerRepository, packageName, version) map {
(repo, name, version) => repo.map(_ + "/").getOrElse("") + name + ":" + version
} The publishLocal <<= (stage, dockerTarget, dockerUpdateLatest, streams) { ... } This results in a docker build command like this
The thing ProposalInstead of introducing a very specific setting dockerBuildOptions := Seq("--force-rm"),
dockerBuildOptions += dockerTags.value.map { tag => s"--tag=${tag.asBuildOption}" }
dockerBuildOptions ++= if(dockerLatest.value) { /* add latest tag */ } else Seq.empty
...
def publishLocalDocker(context: File, options: Seq[String], log: Logger) {
val cmd = Seq("docker", "build") ++ options ++ Seq(".")
// ...
} which would create a general abstraction for the build options. The case class DockerTag(name: String, version: Option[String]) {
def asBuildOption: String = name + version.map(v => s":$v"}.getOrElse("")
} @fiadliel WDYT? |
Sorry about the delay. Document is signed.
|
Hi @dgilling . There is going to be another contribution, implementing the suggested solution above. I would close this pull request in favor of the more generic solution. |
closing in favor of #854 |
Useful if you want other version tags added to Docker Image in addition
to the project version. Examples include tagging by the git hash or git
branch using the sbt-git plugin