Skip to content
Simplistic solution of "Why can't I reach my docker containers by name?" problem. Continuously update hosts file (/etc/hosts) with docker container names and aliases and watch for changes.
JavaScript
Branch: master
Clone or download
Latest commit f422e1a Aug 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin make bin/whales-names executable Aug 1, 2019
src Add support for macos Aug 1, 2019
.eslintrc.json cleanup and update deps Mar 29, 2019
.gitignore support node 6 up with babel Oct 16, 2017
LICENSE Initial commit Oct 13, 2017
README.md add snyk badge Aug 1, 2019
package-lock.json bump version Aug 1, 2019
package.json bump version Aug 1, 2019

README.md

Whales' names 🐋

Simplistic solution of why can't I reach my docker containers by name? problem. Continuously update hosts file (/etc/hosts) with docker container names and aliases and watch for changes.

npm version Known Vulnerabilities

Installation 🔨

$ npm install -g whales-names

Usage 📘

$ whales-names
Synchronizing docker container hostnames in hosts file.

Afterwards you are going to see a new section in the end of your /etc/hosts file:

...

# whales-names begin
172.21.88.220	dfbf5d96df3e node1 
172.21.94.104	79468a158d1e node2
172.21.89.244	0c9b251458f4 db
# whales-names end

You can end it with simple Ctrl+C. Errors, if any are going to be printed on the console.

Elevated privileges ⚠️

Due to file permissions of /etc/hosts file you need to use elevated privileges (run as Administrator, if you will) for running it.

Rae: You like whales?

Jesse: I like him.

Rae: Well, he doesn't like anybody, so stay away from him. You see, Willy's a case. A very special case.

Jesse: So? Who isn't?

Free Willy (1993) 🐳

You can’t perform that action at this time.