Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: generate /etc/hosts file for bridge network mode #10766

Merged
merged 1 commit into from
Jun 16, 2021
Merged

Commits on Jun 16, 2021

  1. docker: generate /etc/hosts file for bridge network mode

    When `network.mode = "bridge"`, we create a pause container in Docker with no
    networking so that we have a process to hold the network namespace we create
    in Nomad. The default `/etc/hosts` file of that pause container is then used
    for all the Docker tasks that share that network namespace. Some applications
    rely on this file being populated.
    
    This changeset generates a `/etc/hosts` file and bind-mounts it to the
    container when Nomad owns the network, so that the container's hostname has an
    IP in the file as expected. The hosts file will include the entries added by
    the Docker driver's `extra_hosts` field.
    
    In this changeset, only the Docker task driver will take advantage of this
    option, as the `exec`/`java` drivers currently copy the host's `/etc/hosts`
    file and this can't be changed without breaking backwards compatibility. But
    the fields are available in the task driver protobuf for community task
    drivers to use if they'd like.
    tgross committed Jun 16, 2021
    Configuration menu
    Copy the full SHA
    74c45bd View commit details
    Browse the repository at this point in the history