Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _vale/config/vocabularies/Docker/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ kubectl
kubefwd
kubelet
lookup
label_file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this to the vocabulary is not the right way to fix this lint error

If this is to disable the sentence case check, you should disable that rule instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it wasn't for the sentence case thing, was being flagged as a 'are you sure you meant..' one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, but there are a lot more headings that are flagged for the same thing in this and the other compose file docs. You could disable spellcheck, or better, wrap the options in code spans, to bypass this rule. Adding all of these params to the vocabulary doesn't seem like a good solution

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok good to know, will resolve in the follow-up as well

macOS
macvlan
mfsymlinks
Expand Down
30 changes: 28 additions & 2 deletions content/reference/compose-file/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,36 @@
`action` defines the action to take when changes are detected. If `action` is set to:

- `rebuild`, Compose rebuilds the service image based on the `build` section and recreates the service with the updated image.
- `restart`, Compose restarts the service container. Available with Docker Compose version 2.32.0 and later.
- `sync`, Compose keeps the existing service container(s) running, but synchronizes source files with container content according to the `target` attribute.
- `sync+restart`, Compose synchronizes source files with container content according to the `target` attribute, and then restarts the container.
- `sync+restart`, Compose synchronizes source files with container content according to the `target` attribute, and then restarts the container. Available with Docker Compose version 2.23.0 and later.
- `sync+exec`, Compose synchronizes source files with container content according to the `target` attribute, and then executes a command inside the container. Available with Docker Compose version 2.32.0 and later.

> `sync+restart` attribute is available with Docker Compose version 2.23.0 and later.
#### exec

Check warning on line 64 in content/reference/compose-file/develop.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.HeadingSentenceCase] Use sentence case for headings: 'exec'. Raw Output: {"message": "[Docker.HeadingSentenceCase] Use sentence case for headings: 'exec'.", "location": {"path": "content/reference/compose-file/develop.md", "range": {"start": {"line": 64, "column": 6}}}, "severity": "WARNING"}

{{< introduced compose 2.23.2 "/manuals/compose/releases/release-notes.md#2232" >}}

`exec` is only relevant when `action` is set to `sync+exec`. Like [service hooks](services.md#post_start), `exec` is used to define the command to be run inside the container once it has started.

- `command`: Specifies the command to run once the container starts. This attribute is required, and you can choose to use either the shell form or the exec form.
- `user`: The user to run the command. If not set, the command is run with the same user as the main service command.
- `privileged`: Lets the command run with privileged access.
- `working_dir`: The working directory in which to run the command. If not set, it is run in the same working directory as the main service command.
- `environment`: Sets the environment variables to run the command. While the command inherits the environment variables defined for the service’s main command, this section lets you add new variables or override existing ones.
Comment on lines +70 to +74
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a consistency question. this bulleted lists uses command: description format, while the one before it uses command, description format. not sure if this was intentional and if so if there is a reason to use one over the other?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True! There was no rhyme or reason to it. Good spot - will do a consistency follow up!


```yaml
services:
frontend:
image: ...
develop:
watch:
# sync content then run command to reload service without interruption
- path: ./etc/config
action: sync+exec
target: /etc/config/
exec:
command: app reload
```

#### ignore

Expand Down
21 changes: 21 additions & 0 deletions content/reference/compose-file/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,27 @@ Compose creates containers with canonical labels:
The `com.docker.compose` label prefix is reserved. Specifying labels with this prefix in the Compose file
results in a runtime error.

### label_file

{{< introduced compose 2.23.2 "/manuals/compose/releases/release-notes.md#2232" >}}

The `label_file` attribute lets you load labels for a service from an external file or a list of files. This provides a convenient way to manage multiple labels without cluttering the Compose file.

The file uses a key-value format, similar to `env_file`. You can specify multiple files as a list. When using multiple files, they are processed in the order they appear in the list. If the same label is defined in multiple files, the value from the last file in the list overrides earlier ones.

```yaml
services:
one:
label_file: ./app.labels

two:
label_file:
- ./app.labels
- ./additional.labels
```

If a label is defined in both the `label_file` and the `labels` attribute, the value in [`labels](#labels) takes precedence.

### links

`links` defines a network link to containers in another service. Either specify both the service name and
Expand Down