From f0173b361f88a6db211450065ee929e5eeb9a706 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Fri, 7 Oct 2016 12:28:42 -0700 Subject: [PATCH 1/4] Fix docker docs; add volumes/logging to changelog --- CHANGELOG.md | 2 ++ website/source/docs/drivers/docker.html.md | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5c54369a..72b40f3d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ IMPROVEMENTS: * client: Enforce shared allocation directory disk usage [GH-1580] * client: Introduce a `secrets/` directory to tasks where sensitive data can be written [GH-1681] + * driver/docker: Support Docker volumes [GH-1767] + * driver/docker: Allow Docker logging to be configured [GH-1767] BUG FIXES: * client: Prevent race when persisting state file [GH-1682] diff --git a/website/source/docs/drivers/docker.html.md b/website/source/docs/drivers/docker.html.md index fef8aac94..af59766c3 100644 --- a/website/source/docs/drivers/docker.html.md +++ b/website/source/docs/drivers/docker.html.md @@ -137,14 +137,24 @@ The `docker` driver supports the following configuration in the job spec: * `shm_size` - (Optional) The size (bytes) of /dev/shm for the container. +* `logging` - (Optional) A key/value map of Docker logging options. The default + value is `syslog`. + + ```hcl + config { + logging { + type = "fluentd" + config { + fluentd-address = "localhost:24224" + } + } + } + ``` + * `volumes` - (Optional) A list of `host_path:container_path` strings to bind host paths to container paths. Can only be run on clients with the `docker.volumes.enabled` option set to true. -* `volumes_from` - (Optional) A list of volumes to inherit from another - container. Can only be run on clients with the `docker.volumes.enabled` - option set to true. - * `work_dir` - (Optional) The working directory inside the container. ### Container Name From 4a8dcf7e856bd40ea10f8829c1dd5f665666cdf0 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Fri, 7 Oct 2016 16:19:05 -0700 Subject: [PATCH 2/4] Add example docker load config --- website/source/docs/drivers/docker.html.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/website/source/docs/drivers/docker.html.md b/website/source/docs/drivers/docker.html.md index af59766c3..c8627519c 100644 --- a/website/source/docs/drivers/docker.html.md +++ b/website/source/docs/drivers/docker.html.md @@ -47,6 +47,16 @@ The `docker` driver supports the following configuration in the job spec: download each of the archive files. The equivalent of `docker load -i path` would be run on each of the archive files. + ```hcl + artifact { + source = "http://path.to/redis.tar" + } + config { + load = ["redis.tar"] + image = "redis" + } + ```` + * `command` - (Optional) The command to run when starting the container. ```hcl From 2d5f9739540ff1390a974d40f2e7e7f317450211 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Fri, 7 Oct 2016 16:23:55 -0700 Subject: [PATCH 3/4] Add docker volume example --- website/source/docs/drivers/docker.html.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/website/source/docs/drivers/docker.html.md b/website/source/docs/drivers/docker.html.md index c8627519c..9f2993a2e 100644 --- a/website/source/docs/drivers/docker.html.md +++ b/website/source/docs/drivers/docker.html.md @@ -165,6 +165,12 @@ The `docker` driver supports the following configuration in the job spec: host paths to container paths. Can only be run on clients with the `docker.volumes.enabled` option set to true. + ```hcl + config { + volumes = ["/path/on/host:/path/in/container"] + } + ``` + * `work_dir` - (Optional) The working directory inside the container. ### Container Name From 1a04d7a3031fb25c4ab934f487caee952b0d3479 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Fri, 7 Oct 2016 16:43:17 -0700 Subject: [PATCH 4/4] Fix ticks --- website/source/docs/drivers/docker.html.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/source/docs/drivers/docker.html.md b/website/source/docs/drivers/docker.html.md index 9f2993a2e..574936205 100644 --- a/website/source/docs/drivers/docker.html.md +++ b/website/source/docs/drivers/docker.html.md @@ -39,7 +39,7 @@ The `docker` driver supports the following configuration in the job spec: config { image = "https://hub.docker.internal/redis:3.2" } - ```` + ``` * `load` - (Optional) A list of paths to image archive files. If this key is not specified, Nomad assumes the `image` is hosted on a repository @@ -55,7 +55,7 @@ The `docker` driver supports the following configuration in the job spec: load = ["redis.tar"] image = "redis" } - ```` + ``` * `command` - (Optional) The command to run when starting the container.