mirror of
https://github.com/docker/compose.git
synced 2026-11-17 13:45:39 +00:00
uid, gid and mode on a service-level configs:/secrets: reference are applied when the object is copied into the container (content: and environment: sources) and dropped when it is bind-mounted (file: sources). That is a property of how the container is created, not of the compose file, and an engine able to set ownership on bind mounts would change the answer. Report them from create(), next to the other creation-time warnings, once per requested service, instead of from the load-time unsupported-attribute check. The false positive on inline and environment sources goes away without post-filtering findings against the loaded project. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
77 lines
1.8 KiB
YAML
77 lines
1.8 KiB
YAML
services:
|
|
# Baseline: deploy.resources/replicas/restart_policy ARE honored outside
|
|
# Swarm, a port without an explicit mode defaults to mode: ingress, and
|
|
# label_file is resolved into real labels by compose-go's loader by
|
|
# default — none of these must ever produce a warning.
|
|
clean:
|
|
image: alpine
|
|
deploy:
|
|
replicas: 2
|
|
resources:
|
|
limits:
|
|
cpus: "0.50"
|
|
memory: 128M
|
|
restart_policy:
|
|
condition: on-failure
|
|
ports:
|
|
- "9090:90"
|
|
label_file:
|
|
- ./labels.env
|
|
|
|
# Every deploy.* sub-attribute that's silently ignored outside Swarm.
|
|
swarm-attrs:
|
|
image: alpine
|
|
credential_spec:
|
|
file: ./creds.json
|
|
deploy:
|
|
mode: replicated
|
|
labels:
|
|
team: backend
|
|
update_config:
|
|
parallelism: 1
|
|
failure_action: rollback
|
|
rollback_config:
|
|
parallelism: 1
|
|
placement:
|
|
constraints:
|
|
- node.role==manager
|
|
endpoint_mode: vip
|
|
|
|
# ports[].mode: host is Swarm-only.
|
|
ports-demo:
|
|
image: alpine
|
|
ports:
|
|
- target: 80
|
|
published: "8080"
|
|
mode: host
|
|
|
|
# volumes[].type: cluster (CSI) has no effect outside Swarm.
|
|
cluster-vol:
|
|
image: alpine
|
|
volumes:
|
|
- type: cluster
|
|
source: my-csi-volume
|
|
target: /data
|
|
|
|
# references the configs/secrets below. Their uid/gid/mode are not a
|
|
# load-time matter — see TestFileReferenceOverridesWarning.
|
|
file-refs:
|
|
image: alpine
|
|
configs:
|
|
- source: myconfig
|
|
secrets:
|
|
- source: mysecret
|
|
|
|
configs:
|
|
myconfig:
|
|
file: ./myconfig.txt
|
|
labels:
|
|
team: backend # configs[].labels: reachable and flagged
|
|
|
|
secrets:
|
|
mysecret:
|
|
file: ./mysecret.txt
|
|
driver_opts: # secrets[].driver_opts: reachable and flagged (unlike configs)
|
|
region: eu-west
|
|
labels:
|
|
team: backend
|