你卷目录
/var/lib/docker/volumes/blog_postgres-data/_data,
and
/var/lib/docker通常安装在
C:UsersPublicdocumentsHyper-VVirtual hard disks. 论如何,您可以
通过查看Docker设置来进行检查。
您可以参考 these docs for info on how to share drives with Docker on
Windows.
BTW,
Source是主机Destination上的位置
,也是以下输出中容器内部的位置:
"Mounts": [{ "Name": "fac362...80535", "Source": "/var/lib/docker/volumes/fac362...80535/_data", "Destination": "/webapp", "Driver": "local", "Mode": "", "RW": true, "Propagation": ""}]===========================================================================
更新以回答评论中的问题:
My main curiosity here is that sharing images etc is great but how do I
share my data?
实际上
volume是为此目的而设计的(在Docker容器中管理数据)。卷中的数据保留在主机FS上,并与
Docker容器/映像的生命周期隔离。您可以通过以下方式批量共享数据:
- 挂载Docker卷以托管和重用它
docker run -v /path/on/host:/path/inside/container image
然后,所有数据将保留在其中
/path/on/host;您可以备份它,将其复制到另一台计算机上,然后以相同的体积重新运行容器。
- Create and mount a data container.
Create a data container:
docker create -v /dbdata --name dbstoretraining/postgres /bin/true
Run other containers based on this container using
--volumes-from:
dockerrun -d --volumes-from dbstore --name db1 training/postgres, then all data
generated by
db1will persist in the volume of container
dbstore.
有关更多信息,您可以参考 official Docker volumes
docs.
简而言之,volumes它只是主机上包含所有
容器数据的目录,因此您可以使用以前使用的任何方法来备份/共享
数据。
我可以像处理图像一样将卷推送到docker-hub吗?
否。您可以将Docker 映像推送到Docker集线器(又称
“注册表”)。但是数据不是。您可以使用
任何喜欢的方法来备份/持久保存/共享数据,但是将数据推送到Docker注册表以共享它没有
任何意义。
我可以进行备份等吗?
是的,如上所述:-)



