-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Container named volume mount source not getting updated #11642
Comments
Only services indeed get recreated after configuration change has been detected. We could do the same for volumes (while bit more complex to manage regarding lifecycle) but this would mean user data would be deleted, which could be an issue. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as not stale anymore due to the recent activity. |
@ndeloof |
@g-kartik nope, as volume name is unique we have no option to keep the existing one |
I did not understand. The issue is regarding when volume names changes in the compose file, the |
right, my bad, have been reading too fast. IMHO we miss a global mechanism to detect volume/config/secrets/networks do not run with desired state, and recreate services accordingly |
Description
I want postgres database to use separate data volumes for each git branch. I am passing the
CURRENT_GIT_BRANCH
value through.env
file.Here is the docker compose file
When executing
docker compose up
for the first time withCURRENT_GIT_BRANCH
asdevelop
, the container gets correctly mounted with the volumecvat_db_develop
.With a new value for the
CURRENT_GIT_BRANCH
, sayfeature
, the volumecvat_db_feature
gets created successfully, however the container volume mount source still refers to the oldcvat_db_develop
volume.The expected behavior is that by changing the name of the named volume:
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: