6.3 Backup container data

Information

Take regular backups of your container data volumes.Containers might run services that are critical for your business. Taking regular
data backups would ensure that if there is ever any loss of data you would still have your
data in backup. The loss of data could be devastating for your business.

Solution

You should follow your organization's policy for data backup. You can take backup of your
container data volume using '--volumes-from' parameter as below-$> docker run <Run arguments> --volumes-from $INSTANCE_ID -v [host-dir]-[container-
dir] <Container Image Name or ID> <Command>For example,docker run --volumes-from 699ee3233b96 -v /mybackup-/backup centos tar cvf
/backup/backup.tar /exampledatatobackupImpact-None.
Default Value-By default, no data backup happens for container data volumes.

See Also

https://workbench.cisecurity.org/files/517