mirror of
https://github.com/docker/compose.git
synced 2026-11-20 06:59:53 +00:00
compose-go resolves each hook against its service at load time: the model itself carries the full container specification a hook runs with, and the runtime consumes it as-is through the standard create path — the runtime-side merge helper goes away. Consuming the full spec means honoring ALL of it: - service references it may carry — volumes_from entries, and service:-scoped network_mode/ipc/pid, inherited or declared — resolve to live container IDs exactly like the service create path does; the daemon knows nothing about service names and rejected them, failing up for any service combining volumes_from with a pre_start hook (locked by an e2e scenario). - hook labels — declared or inherited — merge into the container's labels, the runtime identification set winning on conflicts. - the <API 1.44 network-connect fallback joins the HOOK's networks, not the parent service's: a hook overriding networks was connected to the wrong ones. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
20 lines
364 B
YAML
20 lines
364 B
YAML
services:
|
|
data:
|
|
image: alpine
|
|
init: true
|
|
command: sleep infinity
|
|
volumes:
|
|
- shared:/shared
|
|
app:
|
|
image: alpine
|
|
init: true
|
|
command: sleep infinity
|
|
volumes_from:
|
|
- data
|
|
depends_on:
|
|
data:
|
|
condition: service_started
|
|
pre_start:
|
|
- command: sh -c 'echo ready > /shared/marker'
|
|
volumes:
|
|
shared:
|