The characteristic of Docker determines the containers are non-persistent. Deleting a container also deletes its data. Data volumes provided by Docker can realize persistent storage by mounting to the host directories, but the data volumes in the host have the following limits in the cluster environment:
Data cannot be migrated when containers are migrated between machines.
Different machines cannot share data volumes.
To solve these issues, Alibaba Cloud Container Service provides third-party data volumes. By packaging various cloud storage resources as data volumes, these data volumes can be mounted to containers directly and automatically remounted when containers are restarted or migrated. Currently, OSSFS, NAS, and cloud disks are supported.
Data volumes in swarm mode clusters support automatic backup. In scenarios such as a node fails, the data volume can be automatically migrated together with the container and mounted to the root directory of another Elastic Compute Service (ECS) instance.