docker命名卷存储在哪里? [英] Where docker named volumes are stored?

查看:99
本文介绍了docker命名卷存储在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个 docker-compose.yml 文件

version: '3'

volumes:
  jenkins_home:

services:

  registry:
     image: registry:2
     ports:
       - "5000:5000"

  jenkins:
    image: jenkins/jenkins
    ports:
      - "9090:8080"
    volumes:
      - jenkins_home:/var/jenkins_home

,有一个名为 jenkins_home 的卷,现在我想知道,数据真正保留在哪里?

As you can see, there is a named volume called jenkins_home, now I wonder, where does the data get really persisted?

运行 docker inspect infra_jenkins 我明白了:

 ...
 "Mounts": [
    {
      "Type": "volume",
      "Source": "infra_jenkins_home",
      "Target": "/var/jenkins_home",
      "VolumeOptions": {
      "Labels": {
      "com.docker.stack.namespace": "infra"
              }
          }
      }
],
...

我正在使用 docker stack deploy 命令,群集由三个VirtualBox实例组成。

I am running those services on a local docker swarm cluster using docker stack deploy command, the cluster is composed of three VirtualBox instances.

推荐答案

您可以检查Docker卷并查看详细信息。

You can inspect docker volumes and see detailed informations.

请参见 docker卷参考

编辑(注释建议):

(确切的答案)请参见已经回答的问题

Alternatively (for exact answer) see the already answered question.

这篇关于docker命名卷存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆