Keeps /etc/host sync with docker state. Dresmon stands for D - DNS; RES - resolving; MON - monitor
10K+
Keeps /etc/hosts sync with docker state.
Dresmon stands for:
Dresmon is a tool designed to keep your /etc/hosts file in sync with the state of your Docker containers. It ensures that as containers start, stop, or change their state, the /etc/hosts file is updated accordingly, allowing for seamless localhost DNS resolution of containerized applications on your host.
This project was inspired by discussions in the developer community about the need for a tool that bridges the gap between Docker's dynamic nature and the static nature of the /etc/hosts file. Further inspiration was drawn from projects like JWilder Nginx-Proxy and Traefik.
For a detailed list of inspirations, please refer to CREDITS.md.
Clone the repository:
git clone https://github.com/PapevisO/dresmon.git
Navigate to the project directory:
cd dresmon
Build and Run
Using Docker Compose with pre-built image:
services:
dresmon:
image: papeviso/dresmon:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/hosts:/etc/hosts
docker-compose up -d dresmon
or if it's the only service in your project
docker-compose up -d
Using Docker Compose with manual separately from the project build:
docker build -t dresmon .
services:
dresmon:
image: dresmon
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/hosts:/etc/hosts
docker-compose up -d dresmon
Using Docker Compose with Compose managed build:
git clone https://github.com/PapevisO/dresmon.git
services:
dresmon:
build: dresmon
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/hosts:/etc/hosts
docker-compose up -d --build dresmon
Monitor the logs to ensure Dresmon is functioning as expected:
docker-compose logs -f
Pull the Dresmon image:
docker pull papeviso/dresmon
Run the Dresmon container, ensuring the Docker daemon is accessible:
docker run \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /etc/hosts:/etc/hosts \
papeviso/dresmon
Alternatively, you can build the image inside another Docker container and run it similarly.
DRESMON_EXCLUDE: Domains to exclude from being added to /etc/hosts. Supports wildcard patterns. Delimitered by comma.DRESMON_TLD: Top-level domains that Dresmon should manage. Delimitered by comma. Useful for filtering out unwanted domains.GitHub Repository https://github.com/PapevisO/dresmon
Docker Hub https://hub.docker.com/r/papeviso/dresmon

Content type
Image
Digest
sha256:17c0dd6c4…
Size
128.3 MB
Last updated
almost 3 years ago
docker pull papeviso/dresmon