From 9cda7c331e9b87186a8bf0ab933a56160b6b80b6 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Thu, 3 Nov 2016 08:05:00 -0700 Subject: [PATCH] Add flag `--host` to `service create` and `--host-add/--host-rm` to `service update` This fix tries to address 27902 by adding a flag `--host` to `docker service create` and `--host-add/--host-rm` to `docker service update`, so that it is possible to specify extra `host:ip` settings in `/etc/hosts`. This fix adds `Hosts` in swarmkit's `ContainerSpec` so that it is possible to specify extra hosts during service creation. Related docs has been updated. An integration test has been added. This fix fixes 27902. Signed-off-by: Yong Tang --- docs/reference/commandline/service_create.md | 1 + docs/reference/commandline/service_update.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/reference/commandline/service_create.md b/docs/reference/commandline/service_create.md index 2893c84252..9f441c05fe 100644 --- a/docs/reference/commandline/service_create.md +++ b/docs/reference/commandline/service_create.md @@ -35,6 +35,7 @@ Options: --health-retries int Consecutive failures needed to report unhealthy --health-timeout duration Maximum time to allow one check to run (default none) --help Print usage + --host list Set one or more custom host-to-IP mappings (host:ip) (default []) --hostname string Container hostname -l, --label list Service labels (default []) --limit-cpu decimal Limit CPUs (default 0.000) diff --git a/docs/reference/commandline/service_update.md b/docs/reference/commandline/service_update.md index c5104103cc..51a9dd3dda 100644 --- a/docs/reference/commandline/service_update.md +++ b/docs/reference/commandline/service_update.md @@ -43,6 +43,8 @@ Options: --health-retries int Consecutive failures needed to report unhealthy --health-timeout duration Maximum time to allow one check to run (default none) --help Print usage + --host-add list Add or update a custom host-to-IP mapping (host:ip) (default []) + --host-rm list Remove a custom host-to-IP mapping (host:ip) (default []) --image string Service image tag --label-add list Add or update a service label (default []) --label-rm list Remove a label by its key (default [])