Closed Snijder closed 5 months ago
I'm assuming that what you want is to replace the ${IMAGEVERSION} with whatever you define in the pom.xml and not really use an ARG.
For that, then you need to use a Maven property instead:
<properties>
<IMAGEVERSION>latest</IMAGEVERSION>
</properties>
That works, and I am currently using it to work around it.
However, if I understand the documentation correctly (https://eclipse.dev/jkube/docs/openshift-maven-plugin/#_build_args) we should be able to set a build-arg using the configuration in the pom, but that sets an environment variable instead. Which is not what I was expecting.
We'll have to dig deeper into this. Not sure if this was accounted for while absorbing the Docker Maven Plugin related code.
Describe the bug
I am trying to specify the image version from the pom which I can then use in an ARG in my dockerfile when building on openshift. (related docs)
Eclipse JKube version
1.16.2
Component
Kubernetes Maven Plugin
Apache Maven version
other (please specify in additional context)
Gradle version
None
Steps to reproduce
RUN touch test.txt
FROM docker.io/alpine:${IMAGEVERSION} COPY --from=builder test.txt test.txt
ENTRYPOINT ["ls"]
Sample Reproducer Project
No response
Additional context
Ran on Openshift 4 generatedbuildconfig.yaml.txt The build config exported from openshift. Notice the args are available as ENV. https://github.com/eclipse/jkube/pull/1395 seems related.