moby/daemon/containerd
Paweł Gronowski fcccfeb811
c8d/snapshot: Create any platform if not specified
With containerd snapshotters enabled `docker run` currently fails when
creating a container from an image that doesn't have the default host
platform without an explicit `--platform` selection:

```
$ docker run image:amd64
Unable to find image 'asdf:amd64' locally
docker: Error response from daemon: pull access denied for asdf, repository does not exist or may require 'docker login'.
See 'docker run --help'.
```

This is confusing and the graphdriver behavior is much better here,
because it runs whatever platform the image has, but prints a warning:

```
$ docker run image:amd64
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
```

This commits changes the containerd snapshotter behavior to be the same
as the graphdriver. This doesn't affect container creation when platform
is specified explicitly.

```
$ docker run --rm --platform linux/arm64 asdf:amd64
Unable to find image 'asdf:amd64' locally
docker: Error response from daemon: pull access denied for asdf, repository does not exist or may require 'docker login'.
See 'docker run --help'.
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit e438db19d56bef55f9676af9db46cc04caa6330b)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-01-23 15:05:54 +01:00
..
cache.go c8d/cache: Use ContainerConfig from content store 2024-01-17 14:57:55 +01:00
handlers.go Update cleanup logic to use resolve all images 2023-12-18 14:04:48 -08:00
image.go pkg/platforms: internalize in daemon/containerd 2024-01-23 15:05:50 +01:00
image_builder.go Unmount RWLayer during Commit 2024-01-17 16:29:27 +01:00
image_changes.go c8d/changes: Fix concurrents diffs 2023-10-13 13:15:50 +02:00
image_children.go c8d/cache: Optimize FROM scratch case 2024-01-17 14:57:53 +01:00
image_commit.go Unmount RWLayer during Commit 2024-01-17 16:29:27 +01:00
image_delete.go c8d: make the cache in classic builder work 2024-01-17 14:57:50 +01:00
image_delete_test.go Add support for removing repo and digest 2023-12-18 16:33:53 -08:00
image_events.go Update cleanup logic to use resolve all images 2023-12-18 14:04:48 -08:00
image_exporter.go pkg/platforms: internalize in daemon/containerd 2024-01-23 15:05:50 +01:00
image_history.go pkg/platforms: internalize in daemon/containerd 2024-01-23 15:05:50 +01:00
image_import.go migrate to github.com/containerd/log v0.1.0 2023-10-11 17:52:23 +02:00
image_import_test.go daemon/c8d: Use Docker imagespec 2023-08-31 17:15:05 +02:00
image_list.go c8d: show the real image creation date when listing images 2023-10-25 16:43:24 +02:00
image_manifest.go pkg/platforms: internalize in daemon/containerd 2024-01-23 15:05:50 +01:00
image_prune.go Update cleanup logic to use resolve all images 2023-12-18 14:04:48 -08:00
image_pull.go Fix support for pull by digest 2023-11-13 21:38:51 -08:00
image_push.go Default the auth config domain to the target image domain 2023-11-06 17:02:18 -08:00
image_snapshot.go c8d/snapshot: Create any platform if not specified 2024-01-23 15:05:54 +01:00
image_snapshot_unix.go Update commit id unmap to directly use active mounts 2023-12-22 10:14:44 -08:00
image_snapshot_windows.go Update commit id unmap to directly use active mounts 2023-12-22 10:14:44 -08:00
image_squash.go containerd-integration: prefer error over panic where possible 2022-09-07 22:01:49 +02:00
image_tag.go Update cleanup logic to use resolve all images 2023-12-18 14:04:48 -08:00
image_test.go Add support for removing repo and digest 2023-12-18 16:33:53 -08:00
imagespec.go c8d/cache: Use ContainerConfig from content store 2024-01-17 14:57:55 +01:00
mount.go daemon/c8d: Unmount container fs after unclean shutdown 2023-11-27 12:33:33 +01:00
platform_matchers.go pkg/platforms: internalize in daemon/containerd 2024-01-23 15:05:50 +01:00
progress.go c8d/progress: Remove unused mountable 2023-10-12 11:08:11 +02:00
resolver.go Default the auth config domain to the target image domain 2023-11-06 17:02:18 -08:00
service.go Implement GetLayerFolders for the containerd image store 2024-01-17 16:29:28 +01:00
service_unix.go Implement GetLayerFolders for the containerd image store 2024-01-17 16:29:28 +01:00
service_windows.go Implement GetLayerFolders for the containerd image store 2024-01-17 16:29:28 +01:00
soft_delete.go Update cleanup logic to use resolve all images 2023-12-18 14:04:48 -08:00
store.go daemon/c8d: use new containerd LabelDistributionSource constant 2023-09-21 14:18:42 -06:00