docker-backup
docker-backup copied to clipboard
Backup and restore all HostConfig settings
This ensures new container has all the existing settings like bind mount paths, RestartPolicy, Privileged, etc.
This looks good and should probably be the default, but I wonder if we shouldn't allow to optionally turn this off. I'm a bit worried there may be various situations where the original host config doesn't fully apply to the new container. We could look at the list of HostConfig members and identify problematic candidates.
Yeah that's a good point. While there are a lot of keys I ended up needing in HostConfig, there are even more I never even tried to figure out the function of. There probably are a likely set of keys that don't make sense to store, especially for cases where you're restoring on a different host.
I think the safest option is to backup all of these keys (then there's no regret later from not having information you find you need), but then having a way to choose / filter what gets restored, or at least having a pre-set list of keys to restore that should work in most/all cases.
I think the safest option is to backup all of these keys (then there's no regret later from not having information you find you need), but then having a way to choose / filter what gets restored, or at least having a pre-set list of keys to restore that should work in most/all cases.
I fully agree!