Skip to content

set containerd.io/image.remote.ref label to images and snapshots#1569

Closed
AkihiroSuda wants to merge 1 commit intocontainerd:masterfrom
AkihiroSuda:image-ref-label
Closed

set containerd.io/image.remote.ref label to images and snapshots#1569
AkihiroSuda wants to merge 1 commit intocontainerd:masterfrom
AkihiroSuda:image-ref-label

Conversation

@AkihiroSuda
Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda commented Sep 28, 2017

Signed-off-by: Akihiro Suda [email protected]

This commit sets containerd.io/image.remote.ref label to images and corresponding snapshots.
e.g. docker.io/library/alpine:latest.
(Note that "image reference" differs from "image name": https://godoc.org/github.com/containerd/containerd/remotes#Resolver)

Future version MAY set containerd.io/image.remote.resolver explicitly as well, although we haven't decided any convention for resolver identifier string.
Note that we won't set any registry credential as labels.

Usecase: continuity snapshotter plugin with lazy-pull feature

I'm working on a project that uses continuity manifest (== info for getdents(2) and stat(2)) as an image layer, instead of legacy tar balls.
On initial client.Pull() and image.Unpack(), only the continuity manifest is pulled and unpacked.
This enables running containers without pulling the whole rootfs blobs, and lazily pulling blobs on demand.

@stevvooe suggested me to implement this as a containerd snapshotter (and differ and contentstore) plugin, and I found that such a plugin would need to get remote reference information (containerd.io/image.remote.ref) from the client.

Note that the plugin can resolve the registry credential by itself in its own way, probably via plugin-specific entries in /etc/containerd/config.toml:

# executes `docker-crendial-foobar get` for resolving the credential
[plugins.continuity]
    dockerAuthResolvingMethod = "docker-credential-plugin"
    dockerConfigJSON = "/root/.docker/config.json"

cc @stevvooe @dmcgowan @tonistiigi

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #1569 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1569   +/-   ##
=======================================
  Coverage   42.36%   42.36%           
=======================================
  Files          24       24           
  Lines        3368     3368           
=======================================
  Hits         1427     1427           
  Misses       1612     1612           
  Partials      329      329

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b24acea...c900661. Read the comment docs.

@stevvooe
Copy link
Copy Markdown
Member

What if the snapshot are used with multiple different references? How would that work?

@AkihiroSuda
Copy link
Copy Markdown
Member Author

closing per personal communication

mauriciovasquezbernal pushed a commit to kinvolk/containerd that referenced this pull request Nov 13, 2020
The default values of masked and readonly paths are defined
in populateDefaultUnixSpec, and are used when a sandbox is
created.  It is not, however, used for new containers.  If
a container definition does not contain a security context
specifying masked/readonly paths, a container created from
it does not have masked and readonly paths.

This patch applies the default values to masked and
readonly paths of a new container, when any specific values
are not specified.

Fixes containerd#1569

Signed-off-by: Yohei Ueda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants