Sign inSign up

jaschweder/hosts

By jaschweder

Updated over 7 years ago

Automatic update your hosts file for all running containers

Image
1

3.2K

jaschweder/hosts repository overview

Docker Hosts

Automatic update local hosts files based on containers running

GitHub issues GitHub license Twitter

Getting start

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.

Contribute

Any contribution is welcome, please fork the project and send pull request's.

Maintainer

Jonathan A. Schweder [email protected]

Tag summary

Content type

Image

Digest

Size

35.6 MB

Last updated

over 7 years ago

docker pull jaschweder/hosts