-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config variable in backwards compatibility test #370
Conversation
0d477e4 looks good to me, although I'd be happier about having the
cURL comment there if it had actually been tested ;). I don't
remember enough about Docker's auth to know what to put in the the
auth header. Are there no configs we can fetch from Docker's registry
without auth?
|
@wking |
On Wed, Oct 05, 2016 at 10:33:45PM -0700, xiekeyang wrote:
The ‘Accept: application/vnd.docker.distribution.manifest.v2+json’
And I'm not familiar enough with all of that to be able to run the |
@wking
That is ineffective. But I think it is OK to keep this line.
It fetch Bearer Token, and get config content. |
On Tue, Oct 11, 2016 at 01:41:47AM -0700, xiekeyang wrote:
Then we should probably skip that Accept header in the comment and
Ah, thanks :). Shuffling that around a bit and applying it to the $ TOKEN=$(curl 'https://auth.docker.io/token?service=registry.docker.io&scope=repository:library/docker:pull' | jq -r .token) And that we want to use the raw |
@wking If we really need to put the detail HTTP requests here? It seems to be giving introduction to consumers, that is unnecessary( in my personal opinion). |
On Wed, Oct 12, 2016 at 05:04:31AM -0700, xiekeyang wrote:
I'm fine dropping the curl comments, but if we do that I'd like to |
@wking Updated it. PTAL. The fetching commends looks almost as same as you mentioned. I tried them on my local side, and it works correctly. |
// curl -L -H "Authorization: Bearer ..." -H \ | ||
// -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \ | ||
// https://registry-1.docker.io/v2/library/docker/blobs/sha256:5359a4f250650c20227055957e353e8f8a74152f35fe36f00b6b1f9fc19c8861 | ||
// $TOKEN=$(curl https://auth.docker.io/token\?service\=registry.docker.io\&scope\=repository:library/docker:pull | jq -r .token) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was using a leading $
to represent a shell prompt. If you drop the space, you are dereferencing the left-hand side of the assignment, which is not what you want:
$ $TOKEN=a
bash: =a: command not found
I also prefer wrapping quotes to backslash escapes in the URLs, but that's not a big deal either way.
// -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \ | ||
// https://registry-1.docker.io/v2/library/docker/blobs/sha256:5359a4f250650c20227055957e353e8f8a74152f35fe36f00b6b1f9fc19c8861 | ||
// $TOKEN=$(curl https://auth.docker.io/token\?service\=registry.docker.io\&scope\=repository:library/docker:pull | jq -r .token) | ||
// $MANIFEST=$(curl -H "Authorization: Bearer ${TOKEN}" -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' https://index.docker.io/v2/library/docker/manifests/1.12.1 | jq -r .config.digest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the config digest, not the manifest. If you want to split the manifest out as a separate step, you could use:
$ MANIFEST="$(curl -H "Authorization: Bearer ${TOKEN}" -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' https://index.docker.io/v2/library/docker/manifests/1.12.1)"
$ CONFIG_DIGEST=$(echo "${MANIFEST}" | jq -r .config.digest)
@wking Updated, PTAL, thanks. |
@wking I've dropped |
// https://registry-1.docker.io/v2/library/docker/blobs/sha256:5359a4f250650c20227055957e353e8f8a74152f35fe36f00b6b1f9fc19c8861 | ||
// TOKEN=$(curl https://auth.docker.io/token\?service\=registry.docker.io\&scope\=repository:library/docker:pull | jq -r .token) | ||
// MANIFEST=$(curl -H "Authorization: Bearer ${TOKEN}" -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' https://index.docker.io/v2/library/docker/manifests/1.12.1 | jq -r .config.digest) | ||
// curl -LH "Authorization: Bearer ${TOKEN}" https://index.docker.io/v2/library/docker/blobs/${MANIFEST} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you dropped the prompt $
, you went back to MANIFEST
for the variable name. I still think that this variable should be CONFIG
or CONFIG_DIGEST
.
@wking All right, fixed it. |
On Mon, Oct 17, 2016 at 10:35:01PM -0700, xiekeyang wrote:
Not quite ;). Here's a history of your tip:
What I'd like to see for the troublesome comment is either: // config pulled from docker hub blob store or without prompts: // config pulled from docker hub blob store |
@wking Sorry for my fault. That should be corrected. |
a39089c looks good to me :).
|
Signed-off-by: xiekeyang <[email protected]>
@philips PTAL. |
@opencontainers/image-spec-maintainers PTAL |
The variable name and media type in HTTP header should be config, but not manifest.
Signed-off-by: xiekeyang [email protected]