Description
In CI/CD workflows, changes to volumes may trigger interactive confirmation prompts, which can break automation and require manual intervention.
For example, when an existing volume does not match the Compose specification, Docker may prompt:
Volume "... " exists but doesn't match the Compose specification in the Compose file. Recreate (data will be lost)?
To support non-interactive environments, it would be useful to provide an option to automatically confirm volume recreation in such cases, while keeping the default interactive behavior unchanged.
This behavior is controlled via a per-volume label, allowing precise control when multiple volumes are defined in a single Compose file. The label does not apply globally.
Example
volumes:
my_data:
labels:
com.docker.compose.volume.recreate-when-spec-updated: "true"
use case kimdre/doco-cd#1130
Description
In CI/CD workflows, changes to volumes may trigger interactive confirmation prompts, which can break automation and require manual intervention.
For example, when an existing volume does not match the Compose specification, Docker may prompt:
Volume "... " exists but doesn't match the Compose specification in the Compose file. Recreate (data will be lost)?To support non-interactive environments, it would be useful to provide an option to automatically confirm volume recreation in such cases, while keeping the default interactive behavior unchanged.
This behavior is controlled via a per-volume label, allowing precise control when multiple volumes are defined in a single Compose file. The label does not apply globally.
Example
use case kimdre/doco-cd#1130