-
Notifications
You must be signed in to change notification settings - Fork 86
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
Request BACKUP_CUSTOM_LABEL when stop containers. #47
base: master
Are you sure you want to change the base?
Request BACKUP_CUSTOM_LABEL when stop containers. #47
Conversation
Hmm, maybe I misunderstand, but... isn't that exactly how it's supposed to work? How is it better to require a |
Let's say you have the two unrelated docker-compose stacks like below that both run on the same host and both mount When the grafana backup container starts the backup, it will stop the nextcloud container. This is because it finds the nextcloud container in the following line ( docker-volume-backup/src/backup.sh Line 36 in dd9b142
With this merge request, we avoid this because we request both
|
@jan-brinkmann okay the use case makes sense to me. But wouldn't this mean the container stopping wouldn't work at all unless you specify a |
Yes, that is correct.
To be honest, it is questionable what the default use case is. Imho, running multiple Anyway, is there an elegant way to list all container of a certain Here is an unelegenat way: Inside the backup container, we can run |
That's a valid point. But I wouldn't necessarily orient this discussion at all around Besides, even if we forced you to provide a I would be perfectly happy calling this a feature, not a bug. 😇 Thoughts? |
Hello everyone, Disclaimer: Hoping to not introduce too much noise. Especially due to I'm following this project but not using it. This is not the post that I wanted to write, but is the one that remains after a 10 minutes reseach.
In any case, my gut still tells me that I dont trully understand the necesity of multiple cron daemons other than setup's simplicity and isolation. It defeats the spirit of cron itself. But thats Docker!.
Finally, after a thorough review, the current approach of environment variable (BACKUP_CUSTOM_LABEL) + container label seems the best one to me.
Then, it feels obvious that both labels are equally required (and second one enforces the additional env-var), even when in reality it is not. |
Replying to @jan-brinkmann, that happens with docker swarn and kubernetes? Self-inspection based on docker-compose may end up adding an environment variable 'COMPOSE=true' that triggers this specific behavior. Which is not simpler. |
I totally agree. However, I rate the probability as very low. :) Do we both agree that there should be an advice in the documentiotn to use
Sounds reasonable to me. It is more or less the same approach a suggest. The difference is that it works implicite, isn't it?
I don't know. Never tried Docker Swarm. Regarding Kubernetes, you canot mount the Regards, PS: Please excuse me for the late response. |
@jan-brinkmann thanks again for your great contributions! Just wanted to drop by to say I've been mega busy at the day job, and haven't had time to give this my full attention. I will again in a bit. Hope you understand. |
Currently, there is a bug or, let's say, undesirable behavior when
docker.sock
is mounted. This will fix it:When
docker.sock
is mounted (e.g., if you like to triggerdocker-rotate-backups
by means ofPOST_COMMAND
) andBACKUP_CUSTOM_LABEL
is not set, all containers that have the labeldocker-volume-backup.stop-during-backup=true
will be stopped - regardless if they have another tag or not. This may be not desired.With this pull request, we simply request
BACKUP_CUSTOM_LABEL
to be set in order to stop and start containers.