docker-resolver

command module
v0.2.2-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2017 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Docker resolver - Docker DNS resolver

GoDoc

A simple DNS server + /etc/hosts file updater used to resolve names of local Docker containers.

This app listens to docker events and automatically updates your /etc/hosts file to allow you easy access running containers.

Also you can configure docker daemon to use build in dns server. This can be used to communicate with other docker container

with a known port bound to the Docker bridge using domain names.

Container Registration

docker-resolver uses hostname, container name and DOMAIN_NAME, DNSDOCK_ALIAS env variables to register containers.

For example, the following container would be available as:

  • container.docker
  • container.demo
  • container.dev
  • container.test
  • container.io:
symfony:
    container_name: container
    hostname: container.demo
    build: docker/web
    volumes:
        - .:/var/www/html
    environment:
        DNSDOCK_ALIAS: container.dev,container.test
        DOMAIN_NAME: container.io

Installation

# Compile application
go build

# Move file to /usr/bin/
sudo cp docker-resolver /usr/bin/

Systemd service installation

# Copy service file to systemd
sudo cp systemd/docker-resolver.service /etc/systemd/system/

# Restart systemd configurations
sudo systemctl daemon-reload

# Enable service to start on boot
sudo systemctl enable docker-resolver

# Start service
sudo systemctl start docker-resolver

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址