Commit graph

20 commits

Author SHA1 Message Date
Sebastiaan van Stijn
f061f39145
Merge pull request #46009 from vvoland/c8d-resolve-fix-digested-and-named
c8d/resolveImage: Fix Digested and Named reference
2023-07-19 00:12:03 +02:00
Paweł Gronowski
eaf141c86a
c8d/resolveImage: Fix Digested and Named reference
When resolving a reference that is both a Named and Digested, it could
be resolved to an image that has the same digest, but completely
different repository name.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-07-18 17:55:46 +02:00
Paweł Gronowski
028eab9ebb
c8d/inspect: Don't duplicate digested ref
If image name is already an untagged digested reference, don't produce
additional digested ref.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-07-18 17:47:53 +02:00
Sebastiaan van Stijn
3229517b2c
Merge pull request #45816 from laurazard/fix-non-default-platform-images
c8d/images: handle images without manifests for default platform
2023-06-29 20:54:06 +02:00
Laura Brehm
6d3bcd8017
c8d/images: handle images without manifests for default platform
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-06-28 10:53:43 +02:00
Brian Goff
74da6a6363 Switch all logging to use containerd log pkg
This unifies our logging and allows us to propagate logging and trace
contexts together.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-06-24 00:23:44 +00:00
Tianon Gravi
2a6ff3c24f Use OCI "History" type instead of inventing our own copy
The most notable change here is that the OCI's type uses a pointer for `Created`, which we probably should've been too, so most of these changes are accounting for that (and embedding our `Equal` implementation in the one single place it was used).

Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
2023-06-12 13:47:17 -07:00
Paweł Gronowski
b9b8b6597a
c8d/inspect: Fill Created time if available
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-05-25 14:59:49 +02:00
Laura Brehm
e8be792130
c8d: fix missing image history
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-05-09 16:19:05 +01:00
Laura Brehm
8df3db4b97
c8d: add support for removing images by shortID
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-04-21 10:30:53 +01:00
Sebastiaan van Stijn
0656059ae7
Merge pull request #45122 from vvoland/c8d-upstream-inspect-digest
c8d/inspect: Add digested reference to details
2023-03-30 22:53:12 +02:00
Paweł Gronowski
f09b1022aa
c8d/inspect: Handle dangling images
Don't try to parse dangling images name (they have a non-canonical
format - `moby-dangling@sha256:...`) as a reference.
Log a warning if the image is not dangling and its name is not a valid
named reference.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-30 10:34:38 +02:00
Paweł Gronowski
44d0522848
c8d/inspect: Add digested reference to details
Fixes `RepoDigests` value being `null` in inspect output.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-03-08 11:58:07 +01:00
Laura Brehm
a34060cdb4
Resolve and store manifest when creating container
This addresses the previous issue with the containerd store where, after a container is created, we can't deterministically resolve which image variant was used to run it (since we also don't store what platform the image was fetched for).

This is required for things like `docker commit`, and computing the containers layer size later, since we need to resolve the specific image variant.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-03-06 15:13:36 +01:00
Paweł Gronowski
596c8960b2
c8d: Fix resolving truncated id to a descriptor
Regular expression beginning anchor was placed after `sha256:` digest
prefix.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-01-18 12:10:07 +01:00
Nicolas De Loof
1616a09b61 add support for image inspect with containerd-integration
This is a squashed version of various PRs (or related code-changes)
to implement image inspect with the containerd-integration;

- add support for image inspect
- introduce GetImageOpts to manage image inspect data in backend
- GetImage to return image tags with details
- list images matching digest to discover all tags
- Add ExposedPorts and Volumes to the image returned
- Refactor resolving/getting images
- Return the image ID on inspect
- consider digest and ignore tag when both are set
- docker run --platform

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-05 16:20:41 +01:00
Nicolas De Loof
4dd86a0b33
containerd-integration: prefer error over panic where possible
- prefer error over panic where possible
- ContainerChanges is not implemented by snapshotter-based ImageService

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-07 22:01:49 +02:00
Sebastiaan van Stijn
779a5b3029 ImageService.GetImage(): pass context
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2022-09-07 16:53:45 +02:00
Nicolas De Loof
9a849cc83a
introduce GetImageOpts to manage image inspect data in backend
Currently only provides the existing "platform" option, but more
options will be added in follow-ups.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-16 16:49:46 +02:00
Sebastiaan van Stijn
9c8b0b6050
daemon/containerd: split methods to separate files
This splits the ImageService methods to separate files, to closer
match the existing implementation, and to reduce the amount of code
per file, making it easier to read, and to reduce merge conflicts if
new functionality is added.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-07-18 14:46:31 +02:00