mirror of https://github.com/docker/docs.git
Compose 1.20.0 (#6266)
This commit is contained in:
parent
a8edb4a0b0
commit
12757bf953
|
@ -23,7 +23,7 @@ docker_ce_stable_version: "17.12"
|
|||
latest_stable_docker_engine_api_version: "1.36"
|
||||
docker_ce_edge_version: "18.02"
|
||||
docker_ee_version: "17.06"
|
||||
compose_version: "1.19.0"
|
||||
compose_version: "1.20.0"
|
||||
machine_version: "0.14.0"
|
||||
distribution_version: "2.6"
|
||||
dtr_version: "2.4"
|
||||
|
|
|
@ -317,6 +317,16 @@ Because Docker container names must be unique, you cannot scale a service
|
|||
beyond 1 container if you have specified a custom name. Attempting to do so
|
||||
results in an error.
|
||||
|
||||
### device_cgroup_rules
|
||||
|
||||
> [Added in version 2.3 file format](compose-versioning.md#version-23).
|
||||
|
||||
Add rules to the cgroup allowed devices list.
|
||||
|
||||
device_cgroup_rules:
|
||||
- 'c 1:3 mr'
|
||||
- 'a 7:* rmw'
|
||||
|
||||
### devices
|
||||
|
||||
List of device mappings. Uses the same format as the `--device` docker
|
||||
|
@ -1144,6 +1154,8 @@ expressed in the short form.
|
|||
- `volume`: configure additional volume options
|
||||
- `nocopy`: flag to disable copying of data from a container when a volume is
|
||||
created
|
||||
- `tmpfs`: configure additional tmpfs options
|
||||
- `size`: the size for the tmpfs mount in bytes
|
||||
|
||||
|
||||
```none
|
||||
|
|
|
@ -229,6 +229,7 @@ Introduces the following additional parameters:
|
|||
- `start_period` for [`healthchecks`](compose-file-v2.md#healthcheck)
|
||||
- ["Long syntax" for volumes](compose-file-v2.md#long-syntax)
|
||||
- [`runtime`](compose-file-v2.md#runtime) for service definitions
|
||||
- [`device_cgroup_rules`](compose-file-v2.md#devicecgrouprules)
|
||||
|
||||
### Version 3
|
||||
|
||||
|
@ -411,6 +412,29 @@ It's more complicated if you're using particular configuration features:
|
|||
data:
|
||||
external: true
|
||||
|
||||
## Compatibility mode
|
||||
|
||||
`docker-compose` 1.20.0 introduces a new `--compatibility` flag designed to
|
||||
help developers transition to version 3 more easily. When enabled,
|
||||
`docker-compose` reads the `deploy` section of each service's definition and
|
||||
attempts to translate it into the equivalent version 2 parameter. Currently,
|
||||
the following deploy keys are translated:
|
||||
|
||||
- [resources](index.md#resources) limits and memory reservations
|
||||
- [replicas](index.md#replicas)
|
||||
- [restart_policy](index.md#restartpolicy) `condition` and `max_attempts`
|
||||
|
||||
All other keys are ignored and produce a warning if present. You can review
|
||||
the configuration that will be used to deploy by using the `--compatibility`
|
||||
flag with the `config` command.
|
||||
|
||||
> Do not use this in production!
|
||||
>
|
||||
> We recommend against using `--compatibility` mode in production. Because the
|
||||
> resulting configuration is only an approximate using non-Swarm mode
|
||||
> properties, it may produce unexpected results.
|
||||
|
||||
|
||||
## Compose file format references
|
||||
|
||||
- [Compose file version 3](index.md)
|
||||
|
|
|
@ -14,7 +14,7 @@ Options:
|
|||
--no-cache Do not use cache when building the image.
|
||||
--pull Always attempt to pull a newer version of the image.
|
||||
-m, --memory MEM Sets memory limit for the build container.
|
||||
--build-arg key=val Set build-time variables for one service.
|
||||
--build-arg key=val Set build-time variables for services.
|
||||
```
|
||||
|
||||
Services are built once and then tagged, by default as `project_service`. For
|
||||
|
|
|
@ -6,18 +6,20 @@ notoc: true
|
|||
---
|
||||
|
||||
```
|
||||
Usage: exec [options] SERVICE COMMAND [ARGS...]
|
||||
Usage: exec [options] [-e KEY=VAL...] SERVICE COMMAND [ARGS...]
|
||||
|
||||
Options:
|
||||
-d Detached mode: Run command in the background.
|
||||
--privileged Give extended privileges to the process.
|
||||
-u, --user USER Run the command as this user.
|
||||
-T Disable pseudo-tty allocation. By default `docker-compose exec`
|
||||
allocates a TTY.
|
||||
--index=index index of the container if there are multiple
|
||||
instances of a service [default: 1]
|
||||
-d, --detach Detached mode: Run command in the background.
|
||||
--privileged Give extended privileges to the process.
|
||||
-u, --user USER Run the command as this user.
|
||||
-T Disable pseudo-tty allocation. By default `docker-compose exec`
|
||||
allocates a TTY.
|
||||
--index=index index of the container if there are multiple
|
||||
instances of a service [default: 1]
|
||||
-e, --env KEY=VAL Set environment variables (can be used multiple times,
|
||||
not supported in API < 1.25)
|
||||
```
|
||||
|
||||
This is equivalent of `docker exec`. With this subcommand you can run arbitrary
|
||||
This is the equivalent of `docker exec`. With this subcommand you can run arbitrary
|
||||
commands in your services. Commands are by default allocating a TTY, so you can
|
||||
use a command such as `docker-compose exec web sh` to get an interactive prompt.
|
||||
|
|
|
@ -21,9 +21,12 @@ Usage:
|
|||
docker-compose -h|--help
|
||||
|
||||
Options:
|
||||
-f, --file FILE Specify an alternate Compose file (default: docker-compose.yml)
|
||||
-p, --project-name NAME Specify an alternate project name (default: directory name)
|
||||
-f, --file FILE Specify an alternate compose file
|
||||
(default: docker-compose.yml)
|
||||
-p, --project-name NAME Specify an alternate project name
|
||||
(default: directory name)
|
||||
--verbose Show more output
|
||||
--log-level LEVEL Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
||||
--no-ansi Do not print ANSI control characters
|
||||
-v, --version Print version and exit
|
||||
-H, --host HOST Daemon socket to connect to
|
||||
|
@ -33,11 +36,12 @@ Options:
|
|||
--tlscert CLIENT_CERT_PATH Path to TLS certificate file
|
||||
--tlskey TLS_KEY_PATH Path to TLS key file
|
||||
--tlsverify Use TLS and verify the remote
|
||||
--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)
|
||||
--skip-hostname-check Don't check the daemon's hostname against the
|
||||
name specified in the client certificate
|
||||
--project-directory PATH Specify an alternate working directory
|
||||
(default: the path of the Compose file)
|
||||
--compatibility If set, Compose will attempt to convert deploy
|
||||
keys in v3 files to their non-Swarm equivalent
|
||||
|
||||
Commands:
|
||||
build Build or rebuild services
|
||||
|
@ -66,7 +70,6 @@ Commands:
|
|||
unpause Unpause services
|
||||
up Create and start containers
|
||||
version Show the Docker-Compose version information
|
||||
|
||||
```
|
||||
|
||||
You can use Docker Compose binary, `docker-compose [-f <arg>...] [options]
|
||||
|
|
|
@ -17,7 +17,7 @@ Lists containers.
|
|||
```bash
|
||||
$ docker-compose ps
|
||||
Name Command State Ports
|
||||
--------------------------------------------------------------------------------------------
|
||||
mywordpress_db_1 docker-entrypoint.sh mysqld Up 3306/tcp
|
||||
mywordpress_wordpress_1 /entrypoint.sh apache2-for ... Restarting 0.0.0.0:8000->80/tcp
|
||||
---------------------------------------------------------------------------------------------
|
||||
mywordpress_db_1 docker-entrypoint.sh mysqld Up (healthy) 3306/tcp
|
||||
mywordpress_wordpress_1 /entrypoint.sh apache2-for ... Restarting 0.0.0.0:8000->80/tcp
|
||||
```
|
||||
|
|
|
@ -11,7 +11,8 @@ Usage: pull [options] [SERVICE...]
|
|||
Options:
|
||||
--ignore-pull-failures Pull what it can and ignores images with pull failures.
|
||||
--parallel Pull multiple images in parallel.
|
||||
--quiet Pull without printing progress information
|
||||
-q, --quiet Pull without printing progress information
|
||||
--include-deps Also pull services declared as dependencies
|
||||
```
|
||||
|
||||
Pulls an image associated with a service defined in a `docker-compose.yml` or `docker-stack.yml` file, but does not start containers based on those images.
|
||||
|
|
|
@ -11,7 +11,7 @@ Usage:
|
|||
SERVICE [COMMAND] [ARGS...]
|
||||
|
||||
Options:
|
||||
-d Detached mode: Run container in the background, print
|
||||
-d, --detach 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.
|
||||
|
@ -23,6 +23,8 @@ Options:
|
|||
-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.
|
||||
--use-aliases Use the service's network aliases in the network(s) the
|
||||
container connects to.
|
||||
-v, --volume=[] Bind mount a volume (default [])
|
||||
-T Disable pseudo-tty allocation. By default `docker-compose run`
|
||||
allocates a TTY.
|
||||
|
|
|
@ -9,10 +9,11 @@ notoc: true
|
|||
Usage: up [options] [--scale SERVICE=NUM...] [SERVICE...]
|
||||
|
||||
Options:
|
||||
-d Detached mode: Run containers in the background,
|
||||
-d, --detach Detached mode: Run containers in the background,
|
||||
print new container names. Incompatible with
|
||||
--abort-on-container-exit.
|
||||
--no-color Produce monochrome output.
|
||||
--quiet-pull Pull without printing progress information
|
||||
--no-deps Don't start linked services.
|
||||
--force-recreate Recreate containers even if their configuration
|
||||
and image haven't changed.
|
||||
|
|
|
@ -5,6 +5,92 @@ keywords: release notes, compose
|
|||
toc_max: 2
|
||||
---
|
||||
|
||||
## 1.20.0 (2018-03-20)
|
||||
|
||||
### New features
|
||||
|
||||
#### Compose file version 3.6
|
||||
|
||||
- Introduced version 3.6 of the `docker-compose.yml` specification.
|
||||
This version must be used with Docker Engine 18.02.0 or above.
|
||||
|
||||
- Added support for the `tmpfs.size` property in volume mappings
|
||||
|
||||
#### Compose file version 3.2 and up
|
||||
|
||||
- The `--build-arg` option can now be used without specifying a service
|
||||
in `docker-compose build`
|
||||
|
||||
#### Compose file version 2.3
|
||||
|
||||
- Added support for `device_cgroup_rules` in service definitions
|
||||
|
||||
- Added support for the `tmpfs.size` property in long-form volume mappings
|
||||
|
||||
- The `--build-arg` option can now be used without specifying a service
|
||||
in `docker-compose build`
|
||||
|
||||
#### All formats
|
||||
|
||||
- Added a `--log-level` option to the top-level `docker-compose` command.
|
||||
Accepted values are `debug`, `info`, `warning`, `error`, `critical`.
|
||||
Default log level is `info`
|
||||
|
||||
- `docker-compose run` now allows users to unset the container's entrypoint
|
||||
|
||||
- Proxy configuration found in the `~/.docker/config.json` file now populates
|
||||
environment and build args for containers created by Compose
|
||||
|
||||
- Added the `--use-aliases` flag to `docker-compose run`, indicating that
|
||||
network aliases declared in the service's config should be used for the
|
||||
running container
|
||||
|
||||
- Added the `--include-deps` flag to `docker-compose pull`
|
||||
|
||||
- `docker-compose run` now kills and removes the running container upon
|
||||
receiving `SIGHUP`
|
||||
|
||||
- `docker-compose ps` now shows the containers' health status if available
|
||||
|
||||
- Added the long-form `--detach` option to the `exec`, `run` and `up`
|
||||
commands
|
||||
|
||||
### Bugfixes
|
||||
|
||||
- Fixed `.dockerignore` handling, notably with regard to absolute paths
|
||||
and last-line precedence rules
|
||||
|
||||
- Fixed an issue where Compose would make costly DNS lookups when connecting
|
||||
to the Engine when using Docker For Mac
|
||||
|
||||
- Fixed a bug introduced in 1.19.0 which caused the default certificate path
|
||||
to not be honored by Compose
|
||||
|
||||
- Fixed a bug where Compose would incorrectly check whether a symlink's
|
||||
destination was accessible when part of a build context
|
||||
|
||||
- Fixed a bug where `.dockerignore` files containing lines of whitespace
|
||||
caused Compose to error out on Windows
|
||||
|
||||
- Fixed a bug where `--tls*` and `--host` options wouldn't be properly honored
|
||||
for interactive `run` and `exec` commands
|
||||
|
||||
- A `seccomp:<filepath>` entry in the `security_opt` config now correctly
|
||||
sends the contents of the file to the engine
|
||||
|
||||
- ANSI output for `up` and `down` operations should no longer affect the wrong
|
||||
lines
|
||||
|
||||
- Improved support for non-unicode locales
|
||||
|
||||
- Fixed a crash occurring on Windows when the user's home directory name
|
||||
contained non-ASCII characters
|
||||
|
||||
- Fixed a bug occurring during builds caused by files with a negative `mtime`
|
||||
values in the build context
|
||||
|
||||
- Fixed an encoding bug when streaming build progress
|
||||
|
||||
## 1.19.0 (2018-02-07)
|
||||
|
||||
### Breaking changes
|
||||
|
@ -1699,4 +1785,4 @@ Big thanks to @tomstuart, @EnTeQuAk, @schickling, @aronasorman and @GeoffreyPlit
|
|||
|
||||
## 0.0.1 (2013-12-20)
|
||||
|
||||
Initial release.
|
||||
Initial release.
|
||||
|
|
Loading…
Reference in New Issue