Skip to content

Commit

Permalink
rewrite-timestamp: fix incompatibility with COPY --link
Browse files Browse the repository at this point in the history
Fix issue 4746

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Mar 28, 2024
1 parent ad5a64c commit 49e0eb1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions exporter/containerimage/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/containerd/containerd/content"
"github.com/containerd/containerd/diff"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/labels"
"github.com/containerd/containerd/platforms"
Expand Down Expand Up @@ -421,6 +422,12 @@ func (ic *ImageWriter) rewriteRemoteWithEpoch(ctx context.Context, opts *ImageCo
i, desc := i, desc
info, err := cs.Info(ctx, desc.Digest)
if err != nil {
if errors.Is(err, errdefs.ErrNotFound) {
// blobs for base image layers can be missing here
// https://github.com/moby/buildkit/issues/4746
bklog.G(ctx).WithError(err).Debug("skipping to rewrite")
continue
}
return nil, err
}
diffID := digest.Digest(info.Labels[labels.LabelUncompressed]) // can be empty
Expand Down

0 comments on commit 49e0eb1

Please sign in to comment.