You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm using v2.4 yml as I need to pass extra_hosts to the builder and v3 doesn't seem to support that (yet). I'm evaluating using docker-compose with BuildKit but it seems that extra_hosts are not propagated all the way to the Docker CLI [1].
I tried mounting my own hosts file on top of /etc/hosts but it doesn't seem to be possible inside a "normal" (i.e. unpriviledged, etc.) container.
I also thought about patching docker-compose locally & maintaining a fork, but it doesn't really make sense given that the default (non-CLI) builder works correctly and that I don't stricly need BuildKit (it was meant to be a nice bonus).
Reacted by Stepan Kokhanovskiy, c5c86a, Samoilenko Yuri, eitsupi and Maciej Gawinecki
Faced with same bug. I think that person who added extra_hosts support just forgot about existence of cli builder. So. that probably should be a bug.
Now I can't use buildkit because in my dockerfile there are images from intranet registry. The hostname of this registry are not resolving by google public dns.
This options above are not working if they are specified in a docker-conpose file and docker-compose build start with the COMPOSE_DOCKER_CLI_BUILD=1 environment variable.
Yes, not all options were added in the first implementation of the "cli" based build (also see #6584 (comment)). I think it makes sense to add this though, so contributions welcome.
That said, I think this option can be added to the v3 schema as well, to bring parity with v2. This option is already supported by both the "classic" and BuildKit builders, so I don't see a reason for not adding it.
Activity
skokhanovskiy commentedon May 9, 2020
Faced with same bug. I think that person who added
extra_hostssupport just forgot about existence of cli builder. So. that probably should be a bug.Now I can't use buildkit because in my dockerfile there are images from intranet registry. The hostname of this registry are not resolving by google public dns.
skokhanovskiy commentedon May 9, 2020
So, i fixed issue with unavailable intranet DNS servers by using dnsmasq on the docker0 interface as dedicated DNS server for docker daemon.
Any way, I found that there are another unrealized command-line parameters:
labels(fixed in docker-compose with buildkit does not insert container labels #7242)quietrmgzip(compress)shmsize(shm-size)network_mode(network)extra_hosts(add-host)isolationThis options above are not working if they are specified in a docker-conpose file and
docker-compose buildstart with theCOMPOSE_DOCKER_CLI_BUILD=1environment variable.thaJeztah commentedon May 10, 2020
Yes, not all options were added in the first implementation of the "cli" based build (also see #6584 (comment)). I think it makes sense to add this though, so contributions welcome.
That said, I think this option can be added to the
v3schema as well, to bring parity withv2. This option is already supported by both the "classic" and BuildKit builders, so I don't see a reason for not adding it.thaJeztah commentedon May 10, 2020
opened docker/cli#2517 - if that's accepted, this can be implemented in compose when support for the 3.9 schema is added
syabro commentedon May 11, 2020
@thaJeztah docker/cli#2517 is merged. What's next here? :)
syabro commentedon Aug 27, 2020
@thaJeztah any news?
thaJeztah commentedon Aug 27, 2020
Not sure; there's changes merged in this repository to support the "unified" schema (https://github.com/compose-spec/compose-spec), so perhaps it's supported own the latest version
@aiordache do you know?
dzieciou commentedon Jan 23, 2022
It's been a year and half since last update. Any news on that?
ndeloof commentedon Jan 24, 2022
extra_hostis supported by the Compose Specification: https://github.com/compose-spec/compose-spec/blob/master/build.md#extra_hostsimplemented in compose-go: https://github.com/compose-spec/compose-go/blob/master/types/types.go#L299
and supported by Compose V2: https://github.com/docker/compose/blob/v2/pkg/compose/build.go#L259