Skip to content
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

If no version is specified, the tag should default to "latest" instead of "unspecified" #1096

Closed
sschuberth opened this issue Oct 4, 2018 · 5 comments
Assignees
Milestone

Comments

@sschuberth
Copy link
Contributor

Description of the issue:

When running ./gradlew jibDockerBuild the Docke rimage is always also tagged with "unspecified" even if a tag is specified via jib.to.tags.

Expected behavior:

Only the tags specified via jib.to.tags are used to tag the Docker image.

Steps to reproduce:

Run ./gradlew jibDockerBuild with the configuration as mentioned below. See https:/heremaps/oss-review-toolkit/blob/jib/cli/build.gradle to reproduce.

Environment:

Ubuntu 18.04

jib-gradle-plugin Configuration:

plugins {
    id 'com.google.cloud.tools.jib' version '0.9.11'
}

jib.to.tags = ['latest']

Log output:

Parallel execution with configuration on demand is an incubating feature.
Tagging image with generated image reference cli:unspecified. If you'd like to specify a different tag, you can set the jib.to.image parameter in your build.gradle, or use the --image=<MY IMAGE> commandline flag.
warning: Base image 'gcr.io/distroless/java' does not use a specific image digest - build may not be reproducible

Containerizing application to Docker daemon as cli:unspecified, cli...

Getting base image gcr.io/distroless/java...
Building dependencies layer...
Building classes layer...
Finalizing...
Loading to Docker daemon...

Container entrypoint set to [java, -cp, /app/resources:/app/classes:/app/libs/*, com.here.ort.Main]

Built image to Docker daemon as cli:unspecified, cli

BUILD SUCCESSFUL in 9s
68 actionable tasks: 1 executed, 67 up-to-date
@chanseokoh
Copy link
Member

chanseokoh commented Oct 4, 2018

Hi @sschuberth,

Try jib.to.image = 'cli:latest' (or jib.to.image = 'cli') and remove jib.to.tags. jib.to.tags is for additional tags you want to create on top of your default image (which is cli:unspecified in this case). Will that work?

@coollog
Copy link
Contributor

coollog commented Oct 4, 2018

The unspecified comes from the fact that the project does not have a version specified, as Jib uses the project version as the default tag if jib.to.image is not configured.

@sschuberth
Copy link
Contributor Author

@chanseokoh, yes using jib.to.image = 'cli:latest' or simply jib.to.image = 'cli' works as expected. I have to say I find the current behavior a bit unintuitive. Wouldn't it make more sense to use just latest as the default version?

@chanseokoh
Copy link
Member

Makes sense, especially when considering that jib.to.image = 'cli' gives you cli:latest instead of cli:unspecified.

@coollog
Copy link
Contributor

coollog commented Oct 4, 2018

Yea, I think we can change the behavior to not include a default tag if the version is unspecified.

@coollog coollog added this to the 0.10.1 milestone Oct 4, 2018
@sschuberth sschuberth changed the title Gradle plugin always also tags with "unspecified" If no version is specified, the tag should default to "latest" instead of "unspecified" Oct 4, 2018
@TadCordle TadCordle self-assigned this Oct 18, 2018
@coollog coollog modified the milestones: v0.10.1, v0.10.0 Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants