kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

Kaniko don't rewrite label if it set on FROM image

Open ykruchko opened this issue 5 years ago • 2 comments

Hello. I have docker image myproject/myimage that build and pushed to hub.docker.com Dockerfile: FROM adoptopenjdk:11-jre-hotspot LABEL version=1.0.0 ENTRYPOINT ["/opt/app/entrypoint.sh"] ADD entrypoint.sh /opt/app/entrypoint.sh RUN chmod 750 /opt/app/entrypoint.sh ADD build/app.jar /opt/app/

When I try extend it image with some libs and change label using kaniko, lable are not rewrite Dockerfile: FROM myproject/myimage ADD lib /opt/app/

Build command: /kaniko/executor --context ./ --dockerfile Dockerfile --label version="1.0.1" --destination myproject/myimage2

in myproject/myimage2 image label will be version=1.0.0

ykruchko avatar Nov 27 '20 09:11 ykruchko

Hello Team, is there any plan to address this issue?

hemanthmantri avatar Apr 15 '24 20:04 hemanthmantri

I have a quite similar issue with a multi stage image. If I define labels in the Dockerfile which will be overwritten on build, the labels defined in the Dockerfile keep the original values. In my case, the labels are defined in the last stage of the multi stage image.

j-taurus avatar May 02 '24 11:05 j-taurus