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
{{ message }}
Repository navigation
Add support for build-time extra_hosts for Version 3 #1293
It work well for Version 2.3 since docker/compose#5282 but invalid for Version 3
Reacted by Martijn Kamphuis, Jonathan Crooke, Seb James, Alexandre Ardhuin, anibalrivero, Nick Lapshin, Timothy Pharo, Michael Smith, Karl Stoney, Shlykov Oleg and 20 more
Hi,
Is there any update on this? It feels like a real omission from v3 when it is supported by the docker --add-host command.
I really don't want to adjust our build process to building outside of compose, and I can't use version 2.3 because I lose support for other build aspects I need from 3?
A work around to pass --add-host would be great?
Reacted by Andy Riley, Timothy Pharo, Chris Gillatt, Michael Smith, Karl Stoney, Alexander Varchenko, c5c86a, Nick Lapshin, Simon Borøy, newlukai and 5 more
This was added to the compose 3.9 schema in #2517. The 3.9 schema is not yet released (will be together with the next 20.x release of docker), and will have to be implemented in docker-compose as well (as the docker CLI itself doesn't use the build section of compose files, and only uses docker-compose files for docker stack deploy).
I'm closing this issue here, but subscribe / participate on docker/compose#7323 which is a ticket in the docker-compose repository for this
Activity
anibalrivero commentedon Oct 24, 2018
Is there a known workaround for this? Other than building the images outside of compose.
kinnalru commentedon Oct 25, 2018
I'am using Version 2.3 for building images and other version for deploying.
Stono commentedon Jan 8, 2019
Hi,
Is there any update on this? It feels like a real omission from v3 when it is supported by the
docker --add-hostcommand.I really don't want to adjust our build process to building outside of compose, and I can't use version 2.3 because I lose support for other build aspects I need from 3?
A work around to pass
--add-hostwould be great?c5c86a commentedon Feb 20, 2019
For the following Dockerfile:
The following docker-compose.yml works (if you replace host and IP with your case):
But the following fails (if you replace host and IP with your case):
The error at
docker-compose upis:posix4e commentedon Sep 21, 2019
Any updates this would be very nice
lmammino commentedon Jan 21, 2020
Having this would be great. Currently doing weird hacks to circumvent this limitation... :(
i3inc commentedon May 21, 2020
is this on the radar as something to be fixed?
ghevge commentedon Jun 4, 2020
One more vote here for fixing this limitation. I was trying with 3.5 and the issue is still there
thaJeztah commentedon Jun 11, 2020
This was added to the compose 3.9 schema in #2517. The 3.9 schema is not yet released (will be together with the next 20.x release of docker), and will have to be implemented in docker-compose as well (as the docker CLI itself doesn't use the
buildsection of compose files, and only uses docker-compose files fordocker stack deploy).I'm closing this issue here, but subscribe / participate on docker/compose#7323 which is a ticket in the docker-compose repository for this
dzieciou commentedon Jan 23, 2022
It's been almost a year and half and I can see this implemented. Any update on that?
franchyze923 commentedon Jan 30, 2024
I'm running into this issue as well
burka commentedon May 14, 2024
It's solved in Version 3.9 #2517 - you can add
extra_hosts:inbuild:and works for me. Maybe you need to update docker compose.