Note that 5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef is in there multiple times. This can happen when a RUN command doesn't modify the file system, such as running COPY + RUN chmod vs COPY --chmod.
We are simultaneously kicking off copies for each layer, and if there are duplicates, then a race begins over which copy will run successfully and which will notice that it didn't write the expected number of bytes (because the layer already exists).
error preparing the bundle with cnab-to-oci before pushing: failed commit on ref "layer-sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4": unexpected size 64, expected 32.
We should only copy the unique set of layers in an image, and not kick off extra copies for duplicate layers.
Some images have duplicate layers, for example
docker/whalesay
:Note that
5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef
is in there multiple times. This can happen when a RUN command doesn't modify the file system, such as running COPY + RUN chmod vs COPY --chmod.We are simultaneously kicking off copies for each layer, and if there are duplicates, then a race begins over which copy will run successfully and which will notice that it didn't write the expected number of bytes (because the layer already exists).
This causes the following error in Porter (see https://github.com/getporter/porter/issues/2320):
We should only copy the unique set of layers in an image, and not kick off extra copies for duplicate layers.