Docker容器关闭后,容器产生的数据还在磁盘上?

  • A+
所属分类:Web 学习笔记

docker容器关闭后,如果没有使用数据卷,数据是没有了,如果你想数据持久化,需使用volume或者data container,这样在容器关闭后可以再通过-v或者--volumes-from重新使用以前的数据。

docker数据卷volume学习:https://www.cnblogs.com/edisonchou/p/docker_volumes_introduction.html

docker inspect name#检索查看数据卷路径

docker inspect demo#查看检索demo存储数据

Docker容器关闭后,容器产生的数据还在磁盘上?

这里的volumes为空说明没有数据持久化

zore

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: