Lightweight Docker image to synchronize Docker host's /etc/hosts file with Docker
10K+
Lightweight Docker image to synchronize Docker host's /etc/hosts file with Docker on container start and destruction.
Report Bugs · Request Features
This application makes possible to communicate via network with Docker containers via their container names on the Docker host. It's like as though you were communicating with another container within one!
scratch!EXIT_RESET flag to set if changes to /etc/hosts should be reset on exit.| Environment | Default value | Description |
|---|---|---|
| EXIT_RESET | 1 | Reset /etc/hosts on exit |
To get a local copy up and running follow these simple steps.
docker run -d \
--name docker-hosts-sync \
--privileged \
-e EXIT_RESET=1 \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /etc/hosts:/etc/hosts \
--restart unless-stopped \
jarylc/docker-hosts-sync
docker-hosts-sync:
image: jarylc/docker-hosts-sync
privileged: true
environment:
- EXIT_RESET=1
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/hosts:/etc/hosts
restart: unless-stopped
See the open issues for a list of proposed features (and known issues).
Distributed under the MIT License. See LICENSE for more information.
Jaryl Chng - [email protected]
Project Link: https://gitlab.com/jarylc/docker-hosts-sync/
Content type
Image
Digest
sha256:e230a2fb8…
Size
2.5 MB
Last updated
about 2 years ago
Requires Docker Desktop 4.37.1 or later.