moby--moby/daemon/images
Brian Goff 399695305c Fix builder inconsistent error on buggy platform
When pulling an image by platform, it is possible for the image's
configured platform to not match what was in the manifest list.
The image itself is buggy because either the manifest list is incorrect
or the image config is incorrect. In any case, this is preventing people
from upgrading because many times users do not have control over these
buggy images.

This was not a problem in 19.03 because we did not compare on platform
before. It just assumed if we had the image it was the one we wanted
regardless of platform, which has its own problems.

Example Dockerfile that has this problem:

```Dockerfile
FROM --platform=linux/arm64 k8s.gcr.io/build-image/debian-iptables:buster-v1.3.0
RUN echo hello
```

This fails the first time you try to build after it finishes pulling but
before performing the `RUN` command.
On the second attempt it works because the image is already there and
does not hit the code that errors out on platform mismatch (Actually it
ignores errors if an image is returned at all).

Must be run with the classic builder (DOCKER_BUILDKIT=0).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-01-14 21:45:45 +00:00
..
cache.go Accept platform spec on container create 2020-03-20 16:10:36 -07:00
image.go Don't set default platform on container create 2020-10-20 20:17:23 +00:00
image_builder.go Fix builder inconsistent error on buggy platform 2021-01-14 21:45:45 +00:00
image_commit.go Move ImageService to new package 2018-02-26 16:49:37 -05:00
image_delete.go Accept platform spec on container create 2020-03-20 16:10:36 -07:00
image_events.go Accept platform spec on container create 2020-03-20 16:10:36 -07:00
image_exporter.go Move ImageService to new package 2018-02-26 16:49:37 -05:00
image_history.go Accept platform spec on container create 2020-03-20 16:10:36 -07:00
image_import.go Move ImageService to new package 2018-02-26 16:49:37 -05:00
image_inspect.go Accept platform spec on container create 2020-03-20 16:10:36 -07:00
image_prune.go API: add "prune" events 2020-07-28 12:41:14 +02:00
image_pull.go Store image manifests in containerd content store 2020-11-05 20:02:18 +00:00
image_push.go Revert "Remove the rest of v1 manifest support" 2019-06-18 00:36:01 +00:00
image_search.go Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00
image_search_test.go Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00
image_tag.go Accept platform spec on container create 2020-03-20 16:10:36 -07:00
image_unix.go Move ImageService to new package 2018-02-26 16:49:37 -05:00
image_windows.go Move ImageService to new package 2018-02-26 16:49:37 -05:00
images.go Accept platform spec on container create 2020-03-20 16:10:36 -07:00
locals.go goimports: fix imports 2019-09-18 12:56:54 +02:00
service.go Store image manifests in containerd content store 2020-11-05 20:02:18 +00:00
store.go Store image manifests in containerd content store 2020-11-05 20:02:18 +00:00
store_test.go Store image manifests in containerd content store 2020-11-05 20:02:18 +00:00