Can I suspend and then resume a Docker container?

后端 未结 5 560
被撕碎了的回忆
被撕碎了的回忆 2021-01-31 08:16

I would like to suspend a Docker container and resume later. How can this be done? By suspending I mean that it should save the state of ongoing process (e.g. video encoding) an

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 08:29

    Docker has just released an (as yet) undocumented volumes and data storage feature set. tl;dr if you use the -v commandline option you can specify a path to map outside of the container to a special docker path (/var/lib/docker/volumes/{FULL_ID}) where FULL_ID can be found by docker inspect container_id. An example is docker run -d -v /data danielvf/myapp:1.0 runapp which would externalize the /data directory into a docker volume.

    https://github.com/dotcloud/docker/issues/111

    Roadmap for this feature: (doesn't yet document it's existence): https://github.com/dotcloud/docker/wiki/Volumes-&-persistent-data-storage

提交回复
热议问题