Automatic update your hosts file for all running containers
3.2K
Automatic update local hosts files based on containers running
Start a new container passing your local docker.sock file.
$ docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /etc/hosts:/etc/hosts jaschweder/hosts
Now start any container with a VIRTUAL_HOST environment variable, see an example:
$ docker run -d -e VIRTUAL_HOST=app.local nginx
Then open your browser and access the virtual host that you set in the container (for this example: http://app.local)
That's it, now your hosts file is automaticaly updated each time you create a new container.
Any contribution is welcome, please fork the project and send pull request's.
Jonathan A. Schweder [email protected]
Content type
Image
Digest
Size
35.6 MB
Last updated
over 7 years ago
docker pull jaschweder/hosts