open-nomad/drivers
Tim Gross 7bd61bbf43
docker: generate /etc/hosts file for bridge network mode (#10766)
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.
2021-06-16 14:55:22 -04:00
..
docker docker: generate /etc/hosts file for bridge network mode (#10766) 2021-06-16 14:55:22 -04:00
exec drivers/exec: pass capabilities through executor RPC 2021-05-17 12:37:40 -06:00
java client/fingerprint/java: improve java version string regex matching 2021-06-15 14:15:01 -05:00
mock Add gosimple linter (#9590) 2020-12-09 11:05:18 -08:00
qemu qemu: set the number of cores equal to the number of reserved cores if set 2021-04-15 13:32:33 -04:00
rawexec honor task user when execing into raw_exec task (#9439) 2020-11-25 09:34:10 -05:00
shared docker: generate /etc/hosts file for bridge network mode (#10766) 2021-06-16 14:55:22 -04:00