Comments (8)
Just open a PR, I think. No committee regularly meeting to present a proposal in triplicate to :)
Intuitively I’m a bit skeptical that using a regex is ideal — regexes are fairly costly, and it seems harder to me to be certain that the decision is unambiguous and has been comprehensively tested (we require *_transport.go
to have detailed unit tests).
from image.
Currently the oci
(and oci-archive
) does not allow to refer an image by the manifest digest like docker
transport does with the @digest
syntax.
oci
transport currently supports
Proposal
Add support for digest by using one of (or another)
@digest
Same as used indocker
transport. This would add another constrain on path names and may brake currently used image names. Depends on how widely@
is used in path names currently.:@digest
Does not brake current behavior, because the name is currently already split by:
Must be coordinated with:@index
which should be possible, becauseindex
is a number >= 0 and adigest
is of formatalgorithm:encoded
(see: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests)
from image.
Is there a currently a plan to include this in a further version? If nobody has time currently may I can implement the feature and open a pull request. Only thing that should be defined is the syntax for the digest.
from image.
It’s tracked here as a reasonable RFE; I’m not aware of anyone actively working on it, and a PR would definitely be welcome.
Yes, the syntax is the first thing which needs to be decided. Note that in the algorithm:
encoded syntax linked, it is allowed for algorithm to be composed of digits only… So would the presence of the second :
be the differentiator? Or possibly we could use some other prefix, not @
— that might be less ambiguous but probably much less intuitive.
from image.
My idea was to use a regex to separate between the tag, index and digest form. Something like:
tag: ^:([a-zA-Z0-9_][a-zA-Z0-9-_.]{0,127})$
(based on https://docs.docker.com/engine/reference/commandline/tag/)
index: ^:@([0-9]+)$
digest: ^:@([a-z0-9]+([+._-][a-z0-9]+)*:[a-zA-Z0-9=_-]+)$
The above regex also consider the specific constrains for tag and digest. I'm not sure if the restrictions should be enforced here or if another processing step does this and we only have to distinguish between the different cases.
from image.
@mtrmac what are your thoughts about using regex to separate between these cases? Is this the right way to go or do you have another suggestion?
from image.
Using a regex matcher, or not, is an implementation choice, secondary to choosing the syntax. *shrug*
The above proposes that foo:@0
is an index reference, but foo:@0:0
is a digest reference, differentiated by the presence of the second :
, doesn’t it? Purely in abstract that looks a bit confusing, but in practice the algorithm part is going to be sha256
or something very similar, so this might well be the most practical design.
from image.
Yes, that is correct foo:@0
would be an index and foo:@0:0
is a digest reference. So the second :
(plus some trailing characters) is the main divider.
What is the process to decide which syntax to use or should I just implement it and open a PR?
@mtrmac If I implement this function would a regex solution be accepted or are there other ways to do it which are preferred/used in the library.
from image.
Related Issues (20)
- Docker client code can no longer talk to the latest verson of the docker daemon 25.0.0 HOT 5
- Allow empty OCI configs for artifacts HOT 9
- policy.json overwrite not honouring $XDG_CONFIG_HOME HOT 3
- Podman cannot pull image from local registry HOT 4
- copy.Options.EnsureCompressionVariantsExist doesn’t detect existing variants with zstd:chunked
- support multiple sigstore keys HOT 6
- How can I copy from a tar file stream HOT 7
- "slices" module only in go 1.21 HOT 1
- Cannot pull sigstore signed image with podman HOT 4
- Error inspecting local manifest-lists HOT 6
- platform.WantedPlatforms is noisy on macOS HOT 7
- Incorrect syntax highlighting in containers-transports.5
- Why do we get the whole image when inspect with docker daemon? HOT 2
- Support sigstore BYO PKI verification HOT 1
- Support more arbitrary credential helper executable names? HOT 4
- OCI image index loose the artifactType property on copy HOT 4
- zstd:chunked and layer encryption don’t make sense together HOT 3
- How to change the policy.json default path? HOT 1
- Mirrors are ignored when registry is blocked HOT 11
- Support Witnessing Sigstore Signing with a Timestamp Authority Server HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image.