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

Host /etc/hosts in docker #333

Open
andyneff opened this issue Feb 1, 2021 · 0 comments
Open

Host /etc/hosts in docker #333

andyneff opened this issue Feb 1, 2021 · 0 comments

Comments

@andyneff
Copy link
Member

andyneff commented Feb 1, 2021

Currently docker makes an /etc/hosts file dynamically. So if there are any /etc/hosts settings on the host needed by a container, it will fail

Bad ideas

  • mount hosts:/etc/hosts on top of container:/etc/hosts. This will loose entries that belong there for a container, and will break in more complicated scenarios.
  • mount hosts:/etc/hosts into container:/etc/hosts2, and have an entrypoint concatenate the two. This will not work. /etc/hosts is read only, (and dynamic I think).
  • network mode = hosts. That's not segregated at ALL!

Ideas:

  • mount hosts:/etc/hosts into container:/etc/hosts2, and have an entrypoint concatenate the two.
  • Add the ability to Just-docker-compose to parse /etc/hosts, ignore localhost entries, and turn additional entries into extra_hosts entries.

Related:

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

No branches or pull requests

1 participant