Skip to content

feat(compose): add support for automatic recreation of specific named volumes#1378

Draft
kimdre wants to merge 1 commit into
mainfrom
feat/1130-add-volume-recreation-label
Draft

feat(compose): add support for automatic recreation of specific named volumes#1378
kimdre wants to merge 1 commit into
mainfrom
feat/1130-add-volume-recreation-label

Conversation

@kimdre

@kimdre kimdre commented May 22, 2026

Copy link
Copy Markdown
Owner

Allow recreation of specific named volumes

When Docker Compose detects a named volume definition change, deployment can fail with:

Volume "<name>" exists but doesn't match configuration in compose file. Recreate (data will be lost)?

To opt in to automatic recreation for volumes that are safe to recreate (for example tmpfs-backed volumes),
set the top-level volume label cd.doco.volume.recreate: "true".

Only volumes with this label are eligible. Unlabeled volumes are never removed automatically.

volumes:
  socket:
    name: beszel-agent_socket
    driver: local
    driver_opts:
      type: tmpfs
      device: tmpfs
      o: size=1k,uid=65530,gid=0,mode=0700,noexec
    labels:
      cd.doco.volume.recreate: "true"

@kimdre kimdre added the feature New feature label May 22, 2026
@kimdre kimdre linked an issue May 22, 2026 that may be closed by this pull request
@kimdre kimdre moved this to In Development in Doco-CD May 22, 2026
@qianlongzt

Copy link
Copy Markdown
Contributor

I’m not sure this should be handled in doco-cd. Maybe it belongs in a fork or should be upstreamed to docker/compose.

I opened a PR to Docker Compose. docker/compose#13808

@kimdre kimdre moved this from In Development to Blocked in Doco-CD Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

Status: Blocked

Development

Successfully merging this pull request may close these issues.

Add an option to indicate whether a volume should be recreated.

2 participants