Giter Site home page Giter Site logo

docker-etc-hosts's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

docker-etc-hosts's Issues

Compatibility with docker-mac-net-connect

Hi, @Mahoney !
I found you have the library which can help to automate the workflow of the binding IP addresses with Docker container names
I have tried on my mac to use your lib but without any success. I am wondering is it possible to use it without tuntap?
Thanks.

Make the script work on an M1 mac

The script currently requires bash 5 & needs to run as root (it alters /etc/hosts).

A Mac comes with bash 3.2 (and zsh 5.x).

brew install bash on an M1/ARM64 Mac installs bash 5.x, but to /opt/homebrew/bin - which is not on root's path. (On an x64 Mac it is installed to /usr/local/bin, which is on root's path, so it works.)

So #! /usr/bin/env bash loads bash 3.2.

Options:

  1. Alter root's path to include /opt/homebrew/bin
  2. Find some mechanism for a script to discover later versions of bash if installed?!
  3. Migrate the script to zsh which is installed
  4. Migrate the script to bash 3.2
  5. Just document that it's the user's problem to make /usr/bin/env bash resolve to bash 5.x
  6. Use another approach entirely (dns server running in docker?)

I'm not a massive fan of any of them...

  1. Making root's path include homebrew when homebrew doesn't seems like an invasive thing to do... I'd like this to be less reliant on running as & mucking about with root, not more
  2. I don't even know if this is possible
  3. I've got a reasonable way with this... need a replacement for shopt -s extglob and possibly then replacements for bash's ${sanitised//+([^A-Za-z0-9\.])/-}, ${sanitised#[^[:alnum:]]} & ${sanitised%[^[:alnum:]]} variable substituting
    More seriously, the tests are in bats which seems to be bash specific - I haven't located a zsh test framework yet.
  4. Not sure how to work around the lack of associative arrays...
  5. I hate when things don't install nicely - it's already a bit painful with all the manual chown. Also I'd want to give specific instructions on the "right" way to do this and I'm not sure what that is - alter root's path to include /opt/homebrew/bin I suppose, bit see objections to 1!
  6. This exists - e.g. https://github.com/aacebedo/dnsdock or https://github.com/mageddo/dns-proxy-server - run a dns server inside docker that will pick up containers starting and stopping and use it as the host's DNS.
    I was reluctant to go this way because mucking about with how macOs does DNS choice is something I'm a bit uncomfortable with. If docker isn't running your DNS is broken, for a start. And you have to work out how to configure this DNS server to resolve to the correct "real" DNS server(s). Just mutating /etc/hosts leaves the actual DNS server configuration alone.

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.