You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specify the dockerfile under src/main/docker as follows:
ARG IMAGEVERSION
FROM docker.io/alpine:${IMAGEVERSION} as builder
RUN touch test.txt
FROM docker.io/alpine:${IMAGEVERSION}
COPY --from=builder test.txt test.txt
ENTRYPOINT ["ls"]
run mvn clean verify -Dopenshift.namespace=yournamespacehere
Expected behavior
I expect the build arg to be applied and the ARG in the Dockerfile to be filled at build time.
Runtime
OpenShift
Kubernetes API Server version
1.25.3
Environment
Linux, other (please specify in additional context)
Eclipse JKube Logs
[INFO] --- oc:1.16.2:build (build-main-container) @ test ---
[INFO] oc: Using OpenShift build with strategy Docker
[INFO] oc: Using Dockerfile: /home/asdf/Documents/code/frb-common/helloworld/src/main/docker/Dockerfile
[INFO] oc: Using Docker Context Directory: /home/asdf/Documents/code/frb-common/helloworld/src/main/docker
[WARNING] oc: Dockerfile /home/asdf/Documents/code/frb-common/helloworld/src/main/docker/Dockerfile does not contain an ADD or COPY directive to include assembly created at maven. Ignoring assembly.
[INFO] oc: [image-registry.openshift-image-registry.svc:5000/bl-asdfsnijder/helloworld:latest]: Created docker source tar /home/asdf/Documents/code/frb-common/helloworld/target/docker/image-registry.openshift-image-registry.svc/5000/bl-asdfsnijder/helloworld/latest/tmp/docker-build.tar
[INFO] oc: Adding to Secret pullsecret-jkube
[INFO] oc: Using Secret pullsecret-jkube
[INFO] oc: Updating BuildServiceConfig helloworld-s2i for Docker strategy
[INFO] oc: Adding to ImageStream helloworld
[INFO] oc: Starting Build helloworld-s2i
[INFO] oc: Waiting for build helloworld-s2i-11 to complete...
[INFO] oc: Adding cluster TLS certificate authority to trust store
[INFO] oc: time="2024-03-28T12:48:54Z" level=info msg="Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled"
[INFO] oc: I0328 12:48:54.750934 1 defaults.go:112] Defaulting to storage driver "overlay" with options [mountopt=metacopy=on].
[INFO] oc: Caching blobs under "/var/cache/blobs".
[INFO] oc:
[INFO] oc: Pulling image docker.io/alpine ...
[INFO] oc: Trying to pull docker.io/library/alpine:latest...
[INFO] oc: Getting image source signatures
[INFO] oc: Copying blob sha256:4abcf20661432fb2d719aaf90656f55c287f8ca915dc1c92ec14ff61e67fbaf8
[INFO] oc: Copying config sha256:05455a08881ea9cf0e752bc48e61bbd71a34c029bb13df01e40e3e70e0d007bd
[INFO] oc: Writing manifest to image destination
[INFO] oc: Storing signatures
[INFO] oc: Adding transient rw bind mount for /run/secrets/rhsm
[INFO] oc: time="2024-03-28T12:48:57Z" level=warning msg="missing \"IMAGEVERSION\" build argument. Try adding \"--build-arg IMAGEVERSION=<VALUE>\" to the command line"
[INFO] oc: [1/2] STEP 1/3: FROM docker.io/alpine: AS builder
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. #1395 seems related.
The text was updated successfully, but these errors were encountered:
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.
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
mvn clean verify -Dopenshift.namespace=yournamespacehere
Expected behavior
I expect the build arg to be applied and the ARG in the Dockerfile to be filled at build time.
Runtime
OpenShift
Kubernetes API Server version
1.25.3
Environment
Linux, other (please specify in additional context)
Eclipse JKube Logs
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.
#1395 seems related.
The text was updated successfully, but these errors were encountered: