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

example: build-using-dockerfile #223

Merged
merged 1 commit into from
Dec 19, 2017
Merged

example: build-using-dockerfile #223

merged 1 commit into from
Dec 19, 2017

Conversation

AkihiroSuda
Copy link
Member

This subcommand mimics docker build CLI flags so that Docker users can
more easily get started with BuildKit.

The command name was inspired by buildah bud.

Signed-off-by: Akihiro Suda suda.akihiro@lab.ntt.co.jp

@AkihiroSuda
Copy link
Member Author

p.s. I know dockerfile is being removed from this repo (#163), but I think having this tool in this repo is ok for dev&demo purpose.

@tonistiigi
Copy link
Member

Couldn't this be a wrapper outside the tree that we could promote from here. Not sure if we want to add helper commands that we know we will break in the future. Or maybe we could have a way to extend buildctl if you have binaries like buildctl-bud (similar to git).

@AkihiroSuda
Copy link
Member Author

WDYT about having this command in the examples directory of this repo, so that people can try BuildKit without cloning multiple repos (which causes dependency hell)?

Or maybe we could have a way to extend buildctl if you have binaries like buildctl-bud (similar to git).

If buildctl is intended to be used as a dev tool (as in ctr and swarmctl), I wonder such extension is too much.
Is it rather planned to be used as a regular user command such as docker?

@tonistiigi
Copy link
Member

@AkihiroSuda examples would be fine but I don't know why it would cause dependency hell if it is just a wrapper around buildctl.

If buildctl is intended to be used as a dev tool (as in ctr and swarmctl), I wonder such extension is too much.

Yes, I agree as it would be a stretch at the moment. We would need to have multiple use cases of such extensions to consider it.

@AkihiroSuda AkihiroSuda force-pushed the bud branch 2 times, most recently from 5fdad00 to 742f567 Compare December 18, 2017 04:38
@AkihiroSuda AkihiroSuda changed the title buildctl: add "build-using-dockerfile" ("bud") example] build-using-dockerfile Dec 18, 2017
@AkihiroSuda AkihiroSuda changed the title example] build-using-dockerfile example: build-using-dockerfile Dec 18, 2017
@AkihiroSuda
Copy link
Member Author

Updated PR, but plz feel free to close if this PR is not right.

I don't know why it would cause dependency hell if it is just a wrapper around buildctl.

Because the Go packages are not stabilized.

@tonistiigi
Copy link
Member

Because the Go packages are not stabilized.

Ah, I thought this would just call buildctl directly. But using the client is fine as well (and has more tutorial value in examples folder this way).

@tonistiigi
Copy link
Member

Can you update this to just produce the Docker tarball after #228 . So it works with build-using-dockerfile . | docker load.

Also, I'm not sure about the readme changes. Maybe we can do this in separate PR. I'm thinking moving the llb examples also under the "Examples" title under "LLB" subsection. This could be alternative under the "Building a Dockerfile". I think it is important to still show that buildctl build --frontend= is the main syntax and this is a nice shortcut if you want to do this repeatedly.

This command mimics `docker build` CLI flags so that Docker users can
more easily get started with BuildKit.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
@AkihiroSuda
Copy link
Member Author

updated

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.

Can you add a check to hack/test to confirm that this builds when we change anything(actually should do that for all the examples).

Not in this PR: Do you think we should change SolveOpt to take io.WriteCloser as output to avoid this tmpTar thing. The "output" isn't a real exporter-opt anyway as it is handled on the client side. buildctl could detect it and make it into a typed structure.

@tonistiigi
Copy link
Member

@AkihiroSuda Actually, no need. go test ./... validates this already.

LGTM

@tonistiigi tonistiigi merged commit 25dca1f into moby:master Dec 19, 2017
@AkihiroSuda
Copy link
Member Author

Do you think we should change SolveOpt to take io.WriteCloser as output to avoid this tmpTar thing.

👍

}

func action(clicontext *cli.Context) error {
if tag := clicontext.String("tag"); tag == "" {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this a required value?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is just required for exportation.
We can remove it later.

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