open-nomad/plugins/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
..
proto docker: generate /etc/hosts file for bridge network mode (#10766) 2021-06-16 14:55:22 -04:00
testutils plugins: fix test data race. 2021-06-15 09:31:08 +02:00
utils Remove some dead code 2019-01-08 09:11:48 -05:00
client.go core: propagate remote task handles 2021-04-27 15:07:03 -07:00
cstructs.go drivers: re-export ResourceUsage structs 2019-01-08 09:11:47 -05:00
driver.go docker: generate /etc/hosts file for bridge network mode (#10766) 2021-06-16 14:55:22 -04:00
errors.go Standardize driver health description messages for all drivers 2019-01-06 22:06:38 -06:00
execstreaming.go implemment streaming exec handling in driver grpc handlers 2019-05-09 16:49:08 -04:00
plugin.go drivers: pass logger through driver plugin client 2019-01-25 09:38:41 -05:00
server.go core: propagate remote task handles 2021-04-27 15:07:03 -07:00
task_handle.go core: propagate remote task handles 2021-04-27 15:07:03 -07:00
utils.go docker: generate /etc/hosts file for bridge network mode (#10766) 2021-06-16 14:55:22 -04:00
utils_test.go command: use correct port mapping syntax in examples 2020-11-23 10:25:30 -06:00
versions.go Add plugin API versioning to plugin loader and plugins 2018-12-18 16:48:00 -08:00