GithubHelp home page GithubHelp logo

gregolsky / whales-names Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 5.0 625 KB

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.

License: MIT License

JavaScript 100.00%
docker containers dns hostname hostnames hosts

whales-names's Introduction

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 Build Status

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) ๐Ÿณ

whales-names's People

Contributors

barsonax avatar dependabot[bot] avatar gregolsky avatar mlouage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

whales-names's Issues

SyntaxError: Unexpected token function

With the latest 0.1.4 version I get a "SyntaxError: Unexpected token function" error message when running whales-names. I don't get this error with version 0.1.3.

Detailed information about the error:

C:\Users\user01\AppData\Roaming\nvm\v6.17.1\node_modules\whales-names\src\index.js:10
(async function main() {
       ^^^^^^^^

SyntaxError: Unexpected token function
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\cheem\AppData\Roaming\nvm\v6.17.1\node_modules\whales-names\bin\whales-names:2:1)

Whales-names is losing the original hostnames

Hi,
When I'm using the whales-names sometimes it loses all the content of the hosts file and replaces it exclusively with the Docker hostnames.

Did anyone had same issue?
Don't have exact steps to reproduce but it's really annoying to be happening.

Cheers,
Jack Spektor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.