Open zeljkot opened 4 years ago
Thanks for opening this.
I am not exactly sure whether this should be classified as a bug or not TBH...
@Ladicek @iocanel what do you guys think about this one?
@zeljkot If you know that CI_REGISTRY_IMAGE
never contains a tag, could you perhaps set quarkus.container-image.image
to ${CI_REGISTRY_IMAGE}:${quarkus.application.version:latest}
? (See https://quarkus.io/guides/container-image#container-image-options for the default value of quarkus.container-image.tag
.)
@geoand / @iocanel:
I don't know all the details, but we assume that quarkus.container-image.image
contains the full image name, right? In which case, if the tag is missing, we assume latest
, because that's the default value. That sounds right to me.
But if quarkus.container-image.image
is set, what happens when the other properties (registry, group, name, tag) are set? I kinda have a feeling that this is undefined. Could it be defined in a sensible way? Or could we / should we fail?
@geoand / @iocanel: I don't know all the details, but we assume that
quarkus.container-image.image
contains the full image name, right? In which case, if the tag is missing, we assumelatest
, because that's the default value. That sounds right to me.
Yes, thats is exactly what we do.
But if
quarkus.container-image.image
is set, what happens when the other properties (registry, group, name, tag) are set? I kinda have a feeling that this is undefined. Could it be defined in a sensible way? Or could we / should we fail?
I think we log a warning that they are ignored
Here is the workaround for GitLab:
$ VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
$ export QUARKUS_CONTAINER_IMAGE_IMAGE=${CI_REGISTRY_IMAGE}:${VERSION}
https://quarkus.io/guides/container-image#quarkus-container-image_quarkus.container-image.image Represents the entire image string. If set, then group, name, registry, tags, additionalTags are ignored
Example: quarkus.container-image.image=${IMAGE_NAME}:${CI_COMMIT_TAG}
We have 2 options:
Describe the bug
12070 introduces
quarkus.container-image.image
property, which contains registry and image name for GitLab compatibility. However, it overrides whatever is stored inquarkus.container-image.tag
property and adds thelatest
tag. It does respectadditional-tags
.Note that JIB's and GitLab's definition of an image is different: JIB's contains a version while GitLab's does not. GitLab's CI_REGISTRY_IMAGE, the version is not contained as it does not know which version is being built.
Workaround: add version to additional-tags:
Expected behavior The content of
tag
should be used as a default tag.Actual behavior The image is tagged with the
latest
and additional-tags, while it should be tagged with x.y.z-SNAPSHOT and additional-tags. The content oftag
is ignored.To Reproduce
Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).
Or attach an archive containing the reproducer to the issue.
Steps to reproduce the behavior:
In build a script, set
Configuration
Screenshots (If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
uname -a
orver
:java -version
:mvnw --version
orgradlew --version
):Additional context (Add any other context about the problem here.)