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

Add build option "--hostname" for buildx to be able to customize hostname during build image #474

Closed
ShemTovYosef opened this issue Dec 13, 2020 · 10 comments · Fixed by moby/buildkit#2373
Labels
kind/enhancement New feature or request

Comments

@ShemTovYosef
Copy link

ShemTovYosef commented Dec 13, 2020

Hi,

As part of this task: moby/buildkit#1301 buildkit now supports for customizing hostname like this:
buildctl build --frontend=dockerfile.v0 --local dockerfile=. --local context=. --opt hostname=testtest

I want to ask to add this ability to buildx itself to be able to use it like:
docker build --hostname=testtest -t host .

Thanks,
Yosef

@tonistiigi
Copy link
Member

I guess we can start by adding a build-arg with BUILDKIT_ prefix like we do for some other options.

@ShemTovYosef
Copy link
Author

ShemTovYosef commented Dec 14, 2020

Hi @tonistiigi

At this moment can we call buildx by specifying buildkit options, i.e., if I want to call "--opt hostname=testtest" of buildctl by buildx, is any way to do it?

Like this one but it's not working by using ---config as described in documentation: https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md
docker buildx create --use --name builder-with-opts --config hostname=testtest
but I don't know how to specify hostname in it, this field is not described in buildkitd.toml documentation

@tonistiigi
Copy link
Member

tonistiigi commented Dec 15, 2020

we shouldn't set it per builder, but per build. eg. docker buildx build --build-arg BUILDKIT_SANDBOX_HOSTNAME= .

@ShemTovYosef
Copy link
Author

ping if someone interested to implement it

@ShemTovYosef
Copy link
Author

Any updates on this issue?

@ShemTovYosef
Copy link
Author

Or any workaround how to pass buildkit options from buildx?

@li-zhixin
Copy link

Any updates on this issue?

@ShemTovYosef
Copy link
Author

HI @jingxiaolu
Maybe you will have a time to help with it and finish the final step?

@totszwai
Copy link

totszwai commented Jun 2, 2024

So how do we set hostname with this?

@ShemTovYosef
Copy link
Author

Just to use build arg moby/buildkit#2373

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
4 participants