docker-backup icon indicating copy to clipboard operation
docker-backup copied to clipboard

Backup and restore all HostConfig settings

Open andrewleech opened this issue 4 years ago • 3 comments

This ensures new container has all the existing settings like bind mount paths, RestartPolicy, Privileged, etc.

andrewleech avatar Apr 27 '21 01:04 andrewleech

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.

muesli avatar Apr 28 '21 10:04 muesli

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.

andrewleech avatar Apr 29 '21 04:04 andrewleech

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!

muesli avatar Apr 30 '21 07:04 muesli