Open ewah opened 4 years ago
Thanks @ewah for your issue.
I compared what docker build
does for the similar docker file.
FROM alpine:latest
COPY foo /foo
LABEL testLabel="testLabel"
COPY bar /bar
I do see a difference. Kaniko produces
tejaldesai@tejaldesai-macbookpro2 skaffold (prototype)docker history --no-trunc gcr.io/tejal-test/test-labels-16
IMAGE CREATED CREATED BY SIZE COMMENT
sha256:681fad1585ab9d7a69e6f88cf551c6d13e9022dfe9fd47e389a9b43afeba3cbc 292 years ago COPY bar /bar 0B
<missing> 292 years ago COPY foo /foo 0B
<missing> 2 months ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B
<missing> 2 months ago /bin/sh -c #(nop) ADD file:e69d441d729412d24675dcd33e04580885df99981cec43de8c9b24015313ff8e in / 5.59MB
while docker produces the following
tejaldesai@@integration (master)$ docker history --no-trunc e08ae701ae06
IMAGE CREATED CREATED BY SIZE COMMENT
sha256:e08ae701ae06988b0564cc50fef6e87abd0da76d7fc2b9b63aff4a9411dec37f 59 seconds ago /bin/sh -c #(nop) COPY file:6b373114d678c9051faa1bf642bf298f63a7730b31bb3001016ebb86d8db8285 in /bar 0B
sha256:ed62b3bea3f5265db49c1e2609671dae5c882c8c28412be80248778d04ee2816 59 seconds ago /bin/sh -c #(nop) LABEL testLabel=testLabel 0B
sha256:e16e4d5b10ca92a6c99dbca7952e466eb5143c56930cb51881fef79788e9840b 59 seconds ago /bin/sh -c #(nop) COPY file:b72edb7d498ddd91e5c5116e4ce7a1eade15cdce38ca4f75b01ddff7c55f7e79 in /foo 0B
sha256:e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a 2 months ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B
<missing> 2 months ago /bin/sh -c #(nop) ADD file:e69d441d729412d24675dcd33e04580885df99981cec43de8c9b24015313ff8e in / 5.59MB
experiencing the same issue (0.18.0)
I looked into this issue and I think this is a WONTFIX because the OCI spec applies labels only for the image as a whole and not for the individual history steps.
The only thing to be fixed is the missing created property with the individual steps, but that has to be applied at the go-containerregistry as far as I understand the source correctly.
If I misunderstood the issue I would be happy to fix this here - please provide pointers.
I looked into this issue and I think this is a WONTFIX because the OCI spec applies labels only for the image as a whole and not for the individual history steps.
The only thing to be fixed is the missing created property with the individual steps, but that has to be applied at the go-containerregistry as far as I understand the source correctly.
If I misunderstood the issue I would be happy to fix this here - please provide pointers.
Judging by the specification, kaniko violates the definition of the "history" array with the field "empty_layer" . https://github.com/opencontainers/image-spec/blob/main/config.md#example
Actual behavior building a simple Dockerfile
/kaniko/executor --dockerfile=./Dockerfile --destination=mydockerhub/ed/ed-test:200316-a
After pulling the image. It does show up in
docker inspect mydockerhub/ed/ed-test:200316-a
but missing in
docker history --no-trunc mydockerhub/ed/ed-test:200316-a
Expected behavior
To Reproduce see actual
Additional Information
Dockerfile above
Build Context not necessary, i made dummy files 'a', 'b', 'c' for my own sanity
Kaniko Image (fully qualified with digest)
Triage Notes for the Maintainers
--cache
flag