docs: clarify that tag or digest in fromImage is ignored#49266
docs: clarify that tag or digest in fromImage is ignored#49266vvoland merged 1 commit intomoby:masterfrom
Conversation
|
Don't merge yet; I think this is not correct (after some testing 😞) |
| - name: "fromImage" | ||
| in: "query" | ||
| description: "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed." | ||
| description: "Name of the image to pull. If the name includes a tag or digest, it is ignored. Use the `tag` property to specify the desired tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed." |
There was a problem hiding this comment.
Ah right, @thaJeztah is correct!
If a tag is provided here it will be used, but tag will take precedence if its provided.
So fromImage=ubuntu:latest&tag=noble would actually result in ubuntu:noble being considered
|
OK; looks like it ignored a I guess we tried to avoid accidentally pulling "all tags". # pulls latest
curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/images/create?fromImage=thajeztah/angry-unicorn:latest'
# pulls "0.1.0" tag
curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/images/create?fromImage=thajeztah/angry-unicorn:0.1.0'
# tag query parameter takes precedence; pulls "0.1.0" tag
curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/images/create?fromImage=thajeztah/angry-unicorn:0.1&tag=0.1.0'
# no tag in "fromImage" AND no tag in "tag" parameter; pulls all tags
curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/images/create?fromImage=thajeztah/angry-unicorn'For digests.. it looks like there's some inconsistency; specifying the digest in # pulls by digest
curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/images/create?fromImage=thajeztah/angry-unicorn@sha256:641f09e6a0409cc0a9f98e943dd033aa3b914d9141174c39bc0d00cb9519e07b'
# tag + digest in "fromImage"; tag resolution is skipped and image is pulled by digest
curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/images/create?fromImage=thajeztah/angry-unicorn:0.1.0@sha256:641f09e6a0409cc0a9f98e943dd033aa3b914d9141174c39bc0d00cb9519e07b'This seems inconsistent though; if curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/images/create?fromImage=thajeztah/angry-unicorn@sha256:641f09e6a0409cc0a9f98e943dd033aa3b914d9141174c39bc0d00cb9519e07b&tag=0.1.0'
curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/images/create?fromImage=thajeztah/angry-unicorn:0.1@sha256:641f09e6a0409cc0a9f98e943dd033aa3b914d9141174c39bc0d00cb9519e07b&tag=0.1.0'Passing a tag in curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/images/create?fromImage=thajeztah/angry-unicorn:latest&tag=sha256:641f09e6a0409cc0a9f98e943dd033aa3b914d9141174c39bc0d00cb9519e07b'Passing an incorrect digest through curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/images/create?fromImage=thajeztah/angry-unicorn@sha256:641f09e6a0409cc0a9f98e943dd033aa3b914d9141174c39bc0d00cb9519e07b&tag=sha256:3A2919d0172f7524b2d8df9e50066a682669e6d170ac0f6a49676d54358fe970b5'
{"message":"invalid tag format"}
curl -XPOST --unix-socket /var/run/docker.sock 'http://localhost/v1.47/images/create?fromImage=thajeztah/angry-unicorn:latest&tag=sha256:3A2919d0172f7524b2d8df9e50066a682669e6d170ac0f6a49676d54358fe970b5'
{"message":"invalid tag format"} |
Signed-off-by: David Karlsson <[email protected]>
f8bde2a to
bf7a87a
Compare
|
@thaJeztah @vvoland I've updated to capture some of the nuance that exists here w.r.t. fromImage vs tag. PTAL 🙏🏻 |
Signed-off-by: David Karlsson [email protected]
- What I did
Updated the description for the
fromImageparameter on ImageCreate to clarify that if a tag/digest is provided in this field, it is ignored.- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)