Skip to content

Automate the addition of dns-records to hosts file #20

Description

@febbraro

Outrigger DNS has a number of cases where it will not work:

  • DNS resolution is not supported on Windows
  • DNS resolution is not supported on MacOS when offline (on the airplane, say)
  • Local networking is in some kind of temporary error state.

As a workaround for these issues, we'd like to support easy management of the local hosts file.

rig dns-records --install (or perhaps --save) should inject the output of that command to /etc/hosts and the Windows equivalent.

HELP WANTED
This issue is a great opportunity to learn Golang, the contribution workflow of rig, and incidentally improve rig!

Notes

  • Given the hosts entries will go stale as containers are removed and started, these entries cannot be permanent. Should there also be a cleanup command? Should rig stop run it?
  • How will this interact with VPNs?
  • Users guided to use this command will need guidance about what's happening and how to review it, seems like we'll need some INFO logging to explain.

Testing

  • Use docker-compose run --rm lint to apply the full suite of static analysis tools. If there is a failure, you aren't done yet!
  • Use docker-compose run --rm compile to confirm your code compiles.
  • You can use the binary resulting from the compilation step (located in ./build/darwin/rig) to test that you can install records and then see how curl/browser finds your containers. You can quickly spin up a container to test with docker run --rm -l com.dnsdock.image=outrigger -l com.dnsdock.name=test outrigger/apache-php:php70

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions