Skip to content

Adding an option to docker build to export the hash of the build context #32963

Closed as not planned
@samoht

Description

With #32406 it will be possible to export the image hash into a file when using docker build. This is great to use in scripts to see both the log outputs and to get the image ID but it is sometime not enough for build scripts.

In linuxkit we would like to tag the resulting image with the hash of the sources used to built it. To do this, we used to hash the sources manually -- now we are taking the Git subtree as a less error-prone approximation. I think it would be a great addition to docker build if that hash of the sources would be computed automatically so it could be used as a tag for fully reproducible builds.

For instance:

docker build --bidfile=build.id .

which would put the hash of the build context into build.id.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions