mirror of https://github.com/docker/docs.git
Vnext compose (#2509)
* Adds documentation about the `--ignore-override` option For PR https://github.com/docker/compose/pull/4543 When option `--ignore-override` is provided the `docker-compose.override.yml` file, if it exists, will not be considered for any command. This option has no effect when the `-f` option is used as that explicitly lists the set of files to be considered. Signed-off-by: Dennis Gove <dpgove@gmail.com> * Compose 1.12.0 additions (#2472) * Add mem_reservation to list of v2 options Signed-off-by: Joffrey F <joffrey@docker.com> * Add dns_opt to v2 service configuration Signed-off-by: Joffrey F <joffrey@docker.com> * Add pids_limit to service configurations Signed-off-by: Joffrey F <joffrey@docker.com> * Update list of options for docker-compose rm Signed-off-by: Joffrey F <joffrey@docker.com> * Update list of options for docker-compose config Signed-off-by: Joffrey F <joffrey@docker.com> * Add --exit-code-from to docker-compose up documentation Signed-off-by: Joffrey F <joffrey@docker.com> * Add --parallel to docker-compose pull reference Signed-off-by: Joffrey F <joffrey@docker.com> * Add build-args to docker-compose build reference Signed-off-by: Joffrey F <joffrey@docker.com> * Add --volume to docker-compose run reference Signed-off-by: Joffrey F <joffrey@docker.com> * Add --project-directory to list of docker-compose options Signed-off-by: Joffrey F <joffrey@docker.com> * Add reference docs for images command Signed-off-by: Joffrey F <joffrey@docker.com> * Add documentation for COMPOSE_PATH_SEPARATOR Signed-off-by: Joffrey F <joffrey@docker.com> * Add documentation for cache_from option Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
067756b723
commit
93bab5a66f
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.,
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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.
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue