Skip to content

Conversation

@deitch
Copy link
Collaborator

@deitch deitch commented Nov 11, 2020

Signed-off-by: Avi Deitcher avi@deitcher.net

- What I did

Expanded the packages.md doc to describe how to sign a tag manually. I needed this once in a while, so it is good to know how it works under the covers.

- How I did it

Writing markdown.

- How to verify it

Read it.

- Description for the changelog

Describe how tag signing works.

@deitch deitch requested review from justincormack and rn November 11, 2020 19:39
Copy link
Member

@rn rn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea, but if you have available, I asked for a bit more clarification. I think i may have the info somewhere burried in scripts etc but would need to dig it out

docs/packages.md Outdated
* docker notary signing key passphrase
1. Set an env var with the name of the image **not** including tag. Make sure to include the registry host. For example, `IMAGE=docker.io/linuxkit/containerd`
1. Set an env var with the tag. For example, `TAG=a4aa19c608556f7d786852557c36136255220c1f`. This example is a multi-arch manifest tag, but you could just as easily sign any other tag, such as the tag of an individual arch-specific image, `TAG=a4aa19c608556f7d786852557c36136255220c1f-s390x`.
1. Set an env var with the size of the artifact that is pointed to by the tag, in bytes. If the tag points to an index, then it is the size of the index; if it is a specific manifest, then it is the size of the manifest. For example, `SIZE=1052`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be good to expand on how to get this size. I used the manifest-tool for this, but maybe some docker image inspect | jq magic does this too. I remember a few years back I struggled a lot to get this size value

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually cheat. I have my own utility that retrieves this. I will add general documentation and reference to my own utility. docker image inspect does not provide this IIRC.

docs/packages.md Outdated
1. Set an env var with the name of the image **not** including tag. Make sure to include the registry host. For example, `IMAGE=docker.io/linuxkit/containerd`
1. Set an env var with the tag. For example, `TAG=a4aa19c608556f7d786852557c36136255220c1f`. This example is a multi-arch manifest tag, but you could just as easily sign any other tag, such as the tag of an individual arch-specific image, `TAG=a4aa19c608556f7d786852557c36136255220c1f-s390x`.
1. Set an env var with the size of the artifact that is pointed to by the tag, in bytes. If the tag points to an index, then it is the size of the index; if it is a specific manifest, then it is the size of the manifest. For example, `SIZE=1052`.
1. Set an env var with the hash of the artifact that is pointed to by the tag, **not** including the `sha256:` header. If the tag points ot an index, then it is the hash of the index; if it is a specific manifest, then it is the hash of the manifest. For example, `HASH=66b3d74aeb855f393ddb85e7371a00d5f7994cc26b425825df2ce910583d74dc`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, might be worth expanding on how to get this piece of information

@deitch
Copy link
Collaborator Author

deitch commented Nov 12, 2020

Updated @rn ; take a look.

@justincormack
Copy link
Member

You may as well remove the docker pull one as it does not provide all the data.

You can make a curl version, based on

jwt=$(curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:linuxkit/containerd:pull" | jq -r .token); curl https://index.docker.io/v2/linuxkit/containerd/manifests/v0.8-amd64 -H "Authorization: Bearer ${jwt}" -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -D /dev/stdout -o /dev/null -s

@deitch
Copy link
Collaborator Author

deitch commented Nov 12, 2020

OK

Signed-off-by: Avi Deitcher <avi@deitcher.net>
@deitch
Copy link
Collaborator Author

deitch commented Nov 12, 2020

Updated @justincormack . I included all the relevant media types.

@justincormack justincormack merged commit ad809fa into linuxkit:master Nov 12, 2020
@deitch deitch deleted the doc-signing branch November 12, 2020 14:31
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