Skip to content

Add --resolve-image-digests option to docker-compose config command - #4333

Merged
shin- merged 4 commits into
docker:masterfrom
ucalgary:4332-config-image-digests
Mar 18, 2017
Merged

shin- merged 4 commits into
docker:masterfrom
ucalgary:4332-config-image-digests

Conversation

@kinghuang

Copy link
Copy Markdown

Add an option named --digest to the docker-compose config command. It pins images to specific image digests for compose files, just like the docker-compose bundle command for DAB files.

Resolves #4332.

@shin-

shin- commented Feb 2, 2017

Copy link
Copy Markdown

cc @dnephin for your thoughts - not sure if this was disccused before.

@dnephin

dnephin commented Feb 2, 2017

Copy link
Copy Markdown

I don't know of any previous discussion about this, but it seems like a good idea to me. It's effectively a "pin the image" feature, which I think is good.

On the implementation, I think there is a lot of duplicated code. Can you have it share the code with bundle ?

@kinghuang

Copy link
Copy Markdown
Author

Sure, I can work on refactoring the digests code between bundle and config.

Does --digest sound ok for the option name? Or, would something like --pin-tags be clearer?

@dnephin

dnephin commented Feb 2, 2017

Copy link
Copy Markdown

In the context of docker-compose config I think it could be something like --pin-images-to-digest, or --resolve-image-digests

@kinghuang
kinghuang force-pushed the 4332-config-image-digests branch from 7ac78be to 01e7972 Compare February 12, 2017 18:19
@kinghuang kinghuang changed the title Add --digest option to docker-compose config command Add --resolve-image-digests option to docker-compose config command Feb 12, 2017
@kinghuang
kinghuang force-pushed the 4332-config-image-digests branch 2 times, most recently from 7767a7a to cea5f7e Compare February 12, 2017 19:04
@kinghuang

Copy link
Copy Markdown
Author

The option has been renamed to --resolve-image-digests, and the common code in bundle and config has been moved to a function named image_digests_for_project.

@dnephin dnephin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

Add arguments for image digests in the config.serialize module to
optionally pin images to digests, like bundles.

Signed-off-by: King Chung Huang <[email protected]>
Add a --resolve-image-digests argument to the config command that pins
images to a specific image digest, just like the bundle command. This
can be used to pin images in compose files being used to deploy stacks
in Docker 1.13.

Signed-off-by: King Chung Huang <[email protected]>
Add two unit tests to validate that the denormalize_service_dict
function still works without passing a third argument for image_digest,
and correctly uses an image digest if one is provided.

Signed-off-by: King Chung Huang <[email protected]>
Extract the code in bundle() and config() that translates image tags
into digests into a function named image_digests_for_project().

Signed-off-by: King Chung Huang <[email protected]>
@kinghuang
kinghuang force-pushed the 4332-config-image-digests branch from cea5f7e to 962ba5b Compare March 17, 2017 18:26
@kinghuang

Copy link
Copy Markdown
Author

@shin- What's the process for getting this into a release?

@shin- shin- added this to the 1.12.0 milestone Mar 17, 2017
@shin-

shin- commented Mar 17, 2017

Copy link
Copy Markdown

I still need to take a closer look at it, but tentatively adding to the 1.12 milestone

Thanks for reminding me 👍

@shin- shin- left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you!

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.

4 participants