https://github.com/gregolsky/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.
https://github.com/gregolsky/whales-names
containers dns docker hostname hostnames hosts
Last synced: about 1 year ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/gregolsky/whales-names
- Owner: gregolsky
- License: mit
- Created: 2017-10-13T21:46:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T21:27:34.000Z (over 3 years ago)
- Last Synced: 2025-03-20T02:53:00.661Z (about 1 year ago)
- Topics: containers, dns, docker, hostname, hostnames, hosts
- Language: JavaScript
- Homepage:
- Size: 610 KB
- Stars: 9
- Watchers: 1
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
[](https://badge.fury.io/js/whales-names) [](https://snyk.io/test/github/gregolsky/whales-names) [](https://travis-ci.org/gregolsky/whales-names)
## 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) 🐳