Web based docker container manager. And /etc/hosts
updater.
This app will update the /etc/hosts
file in realtime based on the Docker events of starting/stopping docker containers.
It needs to be running at the time the new containers are started to be able to see the docker events.
It looks at each new started container for 2 values: hostname
and domainname
. It will use those 2 values to provide a FQDN in the hosts
file so you can access local containers by hostname instead of ip address.
Start a docker container with the hostname apache-local
and domain name local-dev
. DoMG will create an entry in the hosts file:
172.xx.xx.xx apache-local.local-dev
You can now access the container's port 80 via http://apache-local.local-dev/
- Create a
docker-compose.yml
file somewhere. - Put this in it:
apps:
image: talpah/domg
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/hosts:/host_hosts
hostname: containers
domainname: domg
- Run
docker-compose up -d
- Access http://containers.domg/
- Run it directly:
docker run --rm --name containers -v /var/run/docker.sock:/var/run/docker.sock -v /etc/hosts:/host_hosts --hostname containers --domainname domg talpah/domg