泊坞窗撰写卷类型-绑定与卷 [英] docker compose volume type - bind vs volume

查看:48
本文介绍了泊坞窗撰写卷类型-绑定与卷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TLDR

docker-compose 中,两者之间有什么区别

In docker-compose, whats the difference between

volumes:
    - type: volume
      source: mydata
      target: /data

volumes:
    - type: bind
      source: mydata
      target: /data

?

问题很长:

docker-compose 文件中指定 volumes 选项时,可以使用

When you specify the volumes option in your docker-compose file, you can use the long-syntax style

根据文档, type 选项接受3个不同的值: volume bind tmpfs :

According to the docs, the type option accepts 3 different values: volume, bind and tmpfs:

我了解 tmpfs 选项-但是我在文档中找不到关于其他两个选项之间的区别的任何参考: bind volume ,有人可以启发我吗?

But I fail to find any reference in the docs about the difference between the other 2 options: bind and volume, could someone enlighten me about that?

推荐答案

当绑定装载是来自主机的文件时,卷更像是

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