VisionSystemsInc / VisionSystemsInc/vsi_common

Host /etc/hosts in docker

Open
#333 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
8
Forks
9
Avg merge
36m
Merged PRs (30d)
1

Description

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:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Just-docker-compose entry point and its handling of Docker host configuration, then review how /etc/hosts and extra_hosts are currently represented. Compare the proposed approaches against Docker's dynamically generated /etc/hosts behavior and container isolation. Done means one agreed approach is implemented and its host-entry behavior is covered by reproducible tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, shell
Domain
devops, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.