Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Save manifest json and digest, and allow specifying platform when pulling images #113

Closed
wants to merge 4 commits into from

Conversation

ixdy
Copy link

@ixdy ixdy commented Oct 12, 2018

These are a few enhancements needed by bazelbuild/rules_docker#543.

First, I'm saving the manifest.json and docker digest of this manifest out to files. This lets us figure out the resolved digest from a tag, so we can reproduce the pull later.

Second, I've added a flag to control which platform image to pull from a manifest list. This way we can let builds be explicit, rather than always pulling linux/amd64 (or worse, whatever is their host platform).

I've tested this manually by pulling several images, but I can't seem to get the tests to run under bazel test - it wants to write out to my $HOME/.config/gcloud/credentials.db, which seems broken.

@ixdy ixdy force-pushed the platforms-and-digests branch from 762e4eb to 5e55649 Compare October 13, 2018 00:14
001.tar.gz <-- the first layer's .tar.gz filesystem delta
001.sha256 <-- the sha256 of 1.tar.gz with a "sha256:" prefix.
config.json <-- only *.json, the image's config
digest <-- sha256 digest of the image's manifest
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering will changing the file structure impact the docker's compatibility to read those image tars?

Copy link
Author

Choose a reason for hiding this comment

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

This change shouldn't affect the code path which produces a tarball that you can docker load - that's produced by the tarball and multi_image_tarball functions, which don't use fast or uncompressed.

I think the only consumer of this directory is v2_2_image.FromDisk, and it looks like it doesn't particularly care about the directory structure, either.

I wish the tests were actually usable, though; it would make me more confident about this change.

@ixdy
Copy link
Author

ixdy commented Oct 15, 2018

I discovered that I can run the tests locally if I use bazel test --strategy=TestRunner=standalone, which is a little unfortunate. I added some test cases to puller_test.sh as well.

@ixdy
Copy link
Author

ixdy commented Nov 13, 2018

attempting to get this reviewed internally instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants