diff --git a/compose/compose-file/compose-file-v2.md b/compose/compose-file/compose-file-v2.md index 14cb2ec59e..0f4234e7a3 100644 --- a/compose/compose-file/compose-file-v2.md +++ b/compose/compose-file/compose-file-v2.md @@ -249,6 +249,13 @@ Custom DNS servers. Can be a single value or a list. - 8.8.8.8 - 9.9.9.9 +### dns_opt + +List of custom DNS options to be added to the container's `resolv.conf` file. + + dns_opt: + - use-vc + - no-tld-query ### dns_search @@ -721,6 +728,15 @@ container and the host operating system the PID address space. Containers launched with this flag will be able to access and manipulate other containers in the bare-metal machine's namespace and vise-versa. +### pids_limit + +> [Added in version 2.1 file format](#version-21). + +Tunes a container's PIDs limit. Set to `-1` for unlimited PIDs. + + pids_limit: 10 + + ### ports Expose ports. Either specify both ports (`HOST:CONTAINER`), or just the container @@ -883,7 +899,7 @@ then read-write will be used. > - container_name > - container_name:rw -### cpu\_shares, cpu\_quota, cpuset, domainname, hostname, ipc, mac\_address, mem\_limit, memswap\_limit, mem\_swappiness, oom_score_adj, privileged, read\_only, restart, shm\_size, stdin\_open, tty, user, working\_dir +### cpu\_shares, cpu\_quota, cpuset, domainname, hostname, ipc, mac\_address, mem\_limit, memswap\_limit, mem\_swappiness, mem\_reservation, oom_score_adj, privileged, read\_only, restart, shm\_size, stdin\_open, tty, user, working\_dir Each of these is a single value, analogous to its [docker run](/engine/reference/run.md) counterpart. @@ -902,6 +918,7 @@ Each of these is a single value, analogous to its mem_limit: 1000000000 memswap_limit: 2000000000 + mem_reservation: 512m privileged: true oom_score_adj: 500 diff --git a/compose/compose-file/index.md b/compose/compose-file/index.md index 74fe08ae55..e2d868563a 100644 --- a/compose/compose-file/index.md +++ b/compose/compose-file/index.md @@ -253,6 +253,18 @@ at build time is the value in the environment where Compose is running. > **Note**: YAML boolean values (`true`, `false`, `yes`, `no`, `on`, `off`) must > be enclosed in quotes, so that the parser interprets them as strings. +#### cache_from + +> **Note:** This option is new in v3.2 + +A list of images that the engine will use for cache resolution. + + build: + context: . + cache_from: + - alpine:latest + - corp/web_app:3.14 + ### cap_add, cap_drop Add or drop container capabilities. diff --git a/compose/extends.md b/compose/extends.md index 87a321a010..7955b91019 100644 --- a/compose/extends.md +++ b/compose/extends.md @@ -26,13 +26,17 @@ services. If a service is defined in both files Compose merges the configurations using the rules described in [Adding and overriding -configuration](extends.md#adding-and-overriding-configuration). +configuration](extends.md#adding-and-overriding-configuration). You can turn off +the automatic use of `docker-compose.override.yml` with command-line option +`--ignore-override`. To use multiple override files, or an override file with a different name, you can use the `-f` option to specify the list of files. Compose merges files in the order they're specified on the command line. See the [`docker-compose` command reference](./reference/overview.md) for more information about -using `-f`. +using `-f`. When using the `-f` option, the use of `--ignore-override` will +have no effect as the full list of used files is whatever you define with the `-f` +option. When you use multiple configuration files, you must make sure all paths in the files are relative to the base Compose file (the first Compose file specified diff --git a/compose/reference/build.md b/compose/reference/build.md index 1f73082534..0259991bf3 100644 --- a/compose/reference/build.md +++ b/compose/reference/build.md @@ -7,12 +7,13 @@ notoc: true --- ``` -Usage: build [options] [SERVICE...] +Usage: build [options] [--build-arg key=val...] [SERVICE...] Options: ---force-rm Always remove intermediate containers. ---no-cache Do not use cache when building the image. ---pull Always attempt to pull a newer version of the image. + --force-rm Always remove intermediate containers. + --no-cache Do not use cache when building the image. + --pull Always attempt to pull a newer version of the image. + --build-arg key=val Set build-time variables for one service. ``` Services are built once and then tagged as `project_service`, e.g., diff --git a/compose/reference/config.md b/compose/reference/config.md index f60eae70e4..b6ac71d0cb 100644 --- a/compose/reference/config.md +++ b/compose/reference/config.md @@ -9,9 +9,11 @@ notoc: true Usage: config [options] Options: --q, --quiet Only validate the configuration, don't print - anything. ---services Print the service names, one per line. + --resolve-image-digests Pin image tags to digests. + -q, --quiet Only validate the configuration, don't print + anything. + --services Print the service names, one per line. + --volumes Print the volume names, one per line. ``` Validate and view the compose file. diff --git a/compose/reference/envvars.md b/compose/reference/envvars.md index 4a00b0d386..9c69b1bfff 100644 --- a/compose/reference/envvars.md +++ b/compose/reference/envvars.md @@ -32,7 +32,8 @@ succession until a file by that name is found. This variable supports multiple compose files separate by a path separator (on Linux and macOS the path separator is `:`, on Windows it is `;`). For example: -`COMPOSE_FILE=docker-compose.yml:docker-compose.prod.yml` +`COMPOSE_FILE=docker-compose.yml:docker-compose.prod.yml`. The path separator +can also be customized using `COMPOSE_PATH_SEPARATOR`. See also the `-f` [command-line option](overview.md). @@ -86,6 +87,11 @@ Enable path conversion from Windows-style to Unix-style in volume definitions. Users of Docker Machine and Docker Toolbox on Windows should always set this. Defaults to `0` Supported values: `true` or `1` to enable, `false` or `0` to disable. +## COMPOSE\_PATH\_SEPARATOR + +If set, the value of the `COMPOSE_FILE` environment variable will be separated +using this character as path separator. + ## Related Information diff --git a/compose/reference/images.md b/compose/reference/images.md new file mode 100644 index 0000000000..b560ea9944 --- /dev/null +++ b/compose/reference/images.md @@ -0,0 +1,15 @@ +--- +description: Lists images used by the project. +keywords: fig, composition, compose, docker, orchestration, cli, images +title: docker-compose images +notoc: true +--- + +``` +Usage: images [options] [SERVICE...] + +Options: +-q Only display image IDs +``` + +List images used by the created containers. diff --git a/compose/reference/index.md b/compose/reference/index.md index 235ae7ef58..45eca3057b 100644 --- a/compose/reference/index.md +++ b/compose/reference/index.md @@ -16,6 +16,7 @@ The following pages describe the usage information for the [docker-compose](over * [events](events.md) * [exec](exec.md) * [help](help.md) +* [images](images.md) * [kill](kill.md) * [logs](logs.md) * [pause](pause.md) diff --git a/compose/reference/overview.md b/compose/reference/overview.md index a75433be81..b8c7b95a3e 100644 --- a/compose/reference/overview.md +++ b/compose/reference/overview.md @@ -33,6 +33,8 @@ Options: --skip-hostname-check Don't check the daemon's hostname against the name specified in the client certificate (for example if your docker host is an IP address) + --project-directory PATH Specify an alternate working directory + (default: the path of the compose file) Commands: build Build or rebuild services @@ -43,6 +45,7 @@ Commands: events Receive real time events from containers exec Execute a command in a running container help Get help on a command + images List images kill Kill containers logs View output from containers pause Pause services diff --git a/compose/reference/pull.md b/compose/reference/pull.md index ccfe66fa54..c37ac58763 100644 --- a/compose/reference/pull.md +++ b/compose/reference/pull.md @@ -9,7 +9,8 @@ notoc: true Usage: pull [options] [SERVICE...] Options: ---ignore-pull-failures Pull what it can and ignores images with pull failures. + --ignore-pull-failures Pull what it can and ignores images with pull failures. + --parallel Pull multiple images in parallel. ``` Pulls service images. diff --git a/compose/reference/rm.md b/compose/reference/rm.md index 40e275c2ec..016c214c76 100644 --- a/compose/reference/rm.md +++ b/compose/reference/rm.md @@ -10,7 +10,9 @@ Usage: rm [options] [SERVICE...] Options: -f, --force Don't ask to confirm removal + -s, --stop Stop the containers, if required, before removing -v Remove any anonymous volumes attached to containers + -a, --all Deprecated - no effect. ``` Removes stopped service containers. diff --git a/compose/reference/run.md b/compose/reference/run.md index 0fc83d8fe2..3da4fed6b3 100644 --- a/compose/reference/run.md +++ b/compose/reference/run.md @@ -6,21 +6,24 @@ notoc: true --- ``` -Usage: run [options] [-e KEY=VAL...] SERVICE [COMMAND] [ARGS...] +Usage: run [options] [-v VOLUME...] [-p PORT...] [-e KEY=VAL...] SERVICE [COMMAND] [ARGS...] Options: --d Detached mode: Run container in the background, print + -d Detached mode: Run container in the background, print new container name. ---name NAME Assign a name to the container ---entrypoint CMD Override the entrypoint of the image. --e KEY=VAL Set an environment variable (can be used multiple times) --u, --user="" Run as specified username or uid ---no-deps Don't start linked services. ---rm Remove container after run. Ignored in detached mode. --p, --publish=[] Publish a container's port(s) to the host ---service-ports Run command with the service's ports enabled and mapped to the host. --T Disable pseudo-tty allocation. By default `docker-compose run` allocates a TTY. --w, --workdir="" Working directory inside the container + --name NAME Assign a name to the container + --entrypoint CMD Override the entrypoint of the image. + -e KEY=VAL Set an environment variable (can be used multiple times) + -u, --user="" Run as specified username or uid + --no-deps Don't start linked services. + --rm Remove container after run. Ignored in detached mode. + -p, --publish=[] Publish a container's port(s) to the host + --service-ports Run command with the service's ports enabled and mapped + to the host. + -v, --volume=[] Bind mount a volume (default []) + -T Disable pseudo-tty allocation. By default `docker-compose run` + allocates a TTY. + -w, --workdir="" Working directory inside the container ``` Runs a one-time command against a service. For example, the following command starts the `web` service and runs `bash` as its command. diff --git a/compose/reference/up.md b/compose/reference/up.md index 3bfd8dff22..3e43260d2b 100644 --- a/compose/reference/up.md +++ b/compose/reference/up.md @@ -28,7 +28,8 @@ Options: running. (default: 10) --remove-orphans Remove containers for services not defined in the Compose file - + --exit-code-from SERVICE Return the exit code of the selected service container. + Implies --abort-on-container-exit. ``` Builds, (re)creates, starts, and attaches to containers for a service.