Open JohanBas opened 9 years ago
Agreed! I'd like to fix this ASAP. The plugin should be able to double-tag the image.
I'd like to tag my image with any number of tags in addition to "${project.version}" and "latest", such as "${project.version}-${gitHash}".
Now I have to delegate the additional tagging to an external bash script, which is invoked by an Exec task which is invoked by distDocker.finalizedBy...
I agree, supporting multiple tags would be helpful.
+1
Totally agree, we'd like to add alway latest and custom tag (project version)
My workaround is to use 2 docker tasks with different tag:
task deployTagDockerImage(type: Docker, dependsOn: build) {
push = false
applicationName = project.name
tagVersion = project.version + '-' + gitCommitIdAbbrev
registry = 'registry'
dockerfile = file "${buildDir}/Dockerfile"
stageDir = file "${buildDir}"
}
task deployDockerImage(type: Docker, dependsOn: deployTagDockerImage) {
push = false
applicationName = project.name
tagVersion = 'latest'
registry = 'registry'
dockerfile = file "${buildDir}/Dockerfile"
stageDir = file "${buildDir}"
}
+1
My workaround:
distDocker << {
def imageTag = "${-> project.group}/${-> applicationName}:"
def tag = project.version
exec {
commandLine "docker", "tag", imageTag + tag, imageTag + "latest"
}
}
Hi, I'd like to have this feature as well. I've sent you a pull request, can you check it out? Thanks.
Travis build failed because of this issue: https://github.com/travis-ci/travis-ci/issues/5227 I changed it to use openjdk8 and it works: https://travis-ci.org/jcfandino/gradle-docker
Is there a reason to use java7 in the build? Should I try to make it work with the old jdk or is it safe to upgrade jdk8?
Any updates on this issue?
This has been open a while, is there any movement on this? Really nice feature to have.
I would like to tag my images with a version tag and latest tag.