Skip to content
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

examples/dockerfile2llb: add --partial-image-config-file, --partial-metadata-file #2793

Merged
merged 2 commits into from
Apr 12, 2022

Conversation

AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda commented Apr 10, 2022

func Dockerfile2LLB(ctx context.Context, dt []byte, opt ConvertOpt) (*llb.State, *Image, *binfotypes.BuildInfo, error) {

The stdout is for *llb.State, --partial-image-config-file is for *Image, --partial-metadata-file is for *binfotypes.BuildInfo.

The *binfotypes.BuildInfo contains source information for docker-image but does not contain other source information such as http.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

This is somewhat confusing as these are not the types that buildctl or docker buildx would write, but the inputs to the actual build. The image config in here only contains partial rootfs and buildinfo only has sources for the tags that Dockerfile frontend replaced before generating LLB. In actual build result metadata there would be more BuildInfo fields.

var opt buildOpt
flag.StringVar(&opt.target, "target", "", "target stage")
flag.StringVar(&opt.imageJSONFile, "image-json-file", "", "Output image config to a file as JSON")
Copy link
Member

Choose a reason for hiding this comment

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

image-config-file maybe as JSON could be manifest as well.

@AkihiroSuda AkihiroSuda marked this pull request as draft April 11, 2022 04:48
…etadata-file

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@AkihiroSuda AkihiroSuda force-pushed the examples-dockefile2llb-metadata branch from 24249f3 to 1a56835 Compare April 11, 2022 07:01
@AkihiroSuda AkihiroSuda changed the title examples/dockerfile2llb: add --image-json-file, --metadata-file examples/dockerfile2llb: add --partial-image-config-file, --partial-metadata-file Apr 11, 2022
@AkihiroSuda
Copy link
Member Author

Changed the flag names to --partial-image-config-file, --partial-metadata-file

@AkihiroSuda AkihiroSuda marked this pull request as ready for review April 11, 2022 07:02
@tonistiigi tonistiigi merged commit c2f909e into moby:master Apr 12, 2022
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.

2 participants