Compose: Docker parameter "dns-opt" not implemented

Created on 22 Mar 2016  路  6Comments  路  Source: docker/compose

Hello,

It would be nice to add support for "--dns-opt" Docker parameter.

Docker feature documented here: https://docs.docker.com/engine/userguide/networking/default_network/configure-dns/

Thanks!

areconfig kinparity

Most helpful comment

Yes, this is not just nice but needed.
I've hit a new (issue)[https://github.com/docker/docker/issues/22185#issuecomment-220556329] and the only decent workaround is to specify a --dns-opt (use-vc). The lack of this in compose means that I will need to start some containers from a bash script instead of from the compose file.

All 6 comments

Yes, this is not just nice but needed.
I've hit a new (issue)[https://github.com/docker/docker/issues/22185#issuecomment-220556329] and the only decent workaround is to specify a --dns-opt (use-vc). The lack of this in compose means that I will need to start some containers from a bash script instead of from the compose file.

I've found another workaround : Add in the entry-point a grep/echo with the options on /etc/resolv.conf:
grep 'options single-request' /etc/resolv.conf || sudo sh -c 'echo "options single-request" >> /etc/resolv.conf'

yes please!

The workaround suggested by @mgodlewski doesn't seem to work anymore (I'm on docker 1.12.5), the /etc/resolve.conf file seems to get replaced by a standard one even if I try to add the options single-request to /etc/resolve.conf in the Dockerfile.

Does anyone have a good workaround for this issue?

The workaround is always working but must be set in an entrypoint (not in a the Dockerfile), since this file is generated on container startup.

Looks like this was implemented in c7b8278e78197b87399977c8a512ef72631816a3 circa 1.12.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

29e7e280-0d1c-4bba-98fe-f7cd3ca7500a picture 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a  路  3Comments

dazorni picture dazorni  路  3Comments

AvdN picture AvdN  路  3Comments

squeaky-pl picture squeaky-pl  路  3Comments

maltefiala picture maltefiala  路  3Comments