You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: fix trailing whitespace from markdown and regenerate
Trailing whitespace in Markdown can force line-breaks, which doesn't seem to
be the intent on these;
find . -type f -print0 | xargs -0 perl -pi -e 's/ +$//'
The trailing whitespace also can cause the YAML to go wonky (although the
cli-docs-tool now takes that into account), and caused the "examples" section
to be missed in the `docker compose pull` page (something we should fix in
the tool).
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Copy file name to clipboardExpand all lines: docs/reference/compose.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,8 @@ multiple services in Docker containers.
9
9
Use the `-f` flag to specify the location of a Compose configuration file.
10
10
11
11
#### Specifying multiple Compose files
12
-
You can supply multiple `-f` configuration files. When you supply multiple files, Compose combines them into a single
13
-
configuration. Compose builds the configuration in the order you supply the files. Subsequent files override and add
12
+
You can supply multiple `-f` configuration files. When you supply multiple files, Compose combines them into a single
13
+
configuration. Compose builds the configuration in the order you supply the files. Subsequent files override and add
14
14
to their predecessors.
15
15
16
16
For example, consider this command line:
@@ -30,7 +30,7 @@ services:
30
30
volumes:
31
31
- "/data"
32
32
```
33
-
If the `docker-compose.admin.yml` also specifies this same service, any matching fields override the previous file.
33
+
If the `docker-compose.admin.yml` also specifies this same service, any matching fields override the previous file.
34
34
New values, add to the `webapp` service configuration.
35
35
36
36
```yaml
@@ -41,40 +41,40 @@ services:
41
41
- DEBUG=1
42
42
```
43
43
44
-
When you use multiple Compose files, all paths in the files are relative to the first configuration file specified
44
+
When you use multiple Compose files, all paths in the files are relative to the first configuration file specified
45
45
with `-f`. You can use the `--project-directory` option to override this base path.
46
46
47
-
Use a `-f` with `-` (dash) as the filename to read the configuration from stdin. When stdin is used all paths in the
47
+
Use a `-f` with `-` (dash) as the filename to read the configuration from stdin. When stdin is used all paths in the
48
48
configuration are relative to the current working directory.
49
49
50
-
The `-f` flag is optional. If you don’t provide this flag on the command line, Compose traverses the working directory
50
+
The `-f` flag is optional. If you don’t provide this flag on the command line, Compose traverses the working directory
51
51
and its parent directories looking for a `compose.yaml` or `docker-compose.yaml` file.
52
52
53
53
#### Specifying a path to a single Compose file
54
-
You can use the `-f` flag to specify a path to a Compose file that is not located in the current directory, either
54
+
You can use the `-f` flag to specify a path to a Compose file that is not located in the current directory, either
55
55
from the command line or by setting up a `COMPOSE_FILE` environment variable in your shell or in an environment file.
56
56
57
-
For an example of using the `-f` option at the command line, suppose you are running the Compose Rails sample, and
58
-
have a `compose.yaml` file in a directory called `sandbox/rails`. You can use a command like `docker compose pull` to
59
-
get the postgres image for the db service from anywhere by using the `-f` flag as follows:
57
+
For an example of using the `-f` option at the command line, suppose you are running the Compose Rails sample, and
58
+
have a `compose.yaml` file in a directory called `sandbox/rails`. You can use a command like `docker compose pull` to
59
+
get the postgres image for the db service from anywhere by using the `-f` flag as follows:
60
60
61
61
```console
62
62
$ docker compose -f ~/sandbox/rails/compose.yaml pull db
63
63
```
64
64
65
65
### Use `-p` to specify a project name
66
66
67
-
Each configuration has a project name. If you supply a `-p` flag, you can specify a project name. If you don’t
68
-
specify the flag, Compose uses the current directory name.
67
+
Each configuration has a project name. If you supply a `-p` flag, you can specify a project name. If you don’t
68
+
specify the flag, Compose uses the current directory name.
69
69
Project name can also be set by `COMPOSE_PROJECT_NAME` environment variable.
70
70
71
-
Most compose subcommand can be ran without a compose file, just passing
71
+
Most compose subcommand can be ran without a compose file, just passing
72
72
project name to retrieve the relevant resources.
73
73
74
74
```console
75
75
$ docker compose -p my_project ps -a
76
76
NAME SERVICE STATUS PORTS
77
-
my_project_demo_1 demo running
77
+
my_project_demo_1 demo running
78
78
79
79
$ docker compose -p my_project logs
80
80
demo_1 | PING localhost (127.0.0.1): 56 data bytes
@@ -84,8 +84,8 @@ demo_1 | 64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.095 ms
84
84
### Use profiles to enable optional services
85
85
86
86
Use `--profile` to specify one or more active profiles
87
-
Calling `docker compose --profile frontend up` will start the services with the profile `frontend` and services
88
-
without any specified profiles.
87
+
Calling `docker compose --profile frontend up` will start the services with the profile `frontend` and services
88
+
without any specified profiles.
89
89
You can also enable multiple profiles, e.g. with `docker compose --profile frontend --profile debug up` the profiles `frontend` and `debug` will be enabled.
90
90
91
91
Profiles can also be set by `COMPOSE_PROFILES` environment variable.
@@ -100,5 +100,5 @@ and so does `COMPOSE_PROFILES` environment variable for to the `--profiles` flag
100
100
101
101
If flags are explicitly set on command line, associated environment variable is ignored
102
102
103
-
Setting the `COMPOSE_IGNORE_ORPHANS` environment variable to `true` will stop docker compose from detecting orphaned
103
+
Setting the `COMPOSE_IGNORE_ORPHANS` environment variable to `true` will stop docker compose from detecting orphaned
0 commit comments