docker-compose.yml 文件命名约定 [英] docker-compose.yml file naming convention

查看:73
本文介绍了docker-compose.yml 文件命名约定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

docker-compose.yml 文件的命名约定是什么?它应该总是这样命名还是我可以自由地将它重命名为,例如,docker-compose-jenkins.yml?

What is the naming convention for the docker-compose.yml file? Should it always be named like this or am I free to rename it to, for instance, docker-compose-jenkins.yml?

推荐答案

默认名称:

注意 docker-compose.yml 是默认名称,所以如果你想使用 docker-compose up 不指定文件名,您将需要使用该格式.如前所述,您可以使用多个文件作为覆盖(参见 docs),通过指定一个file per -f 参数.

default name:

Note that docker-compose.yml is the default name so if you want to use docker-compose up without specifying a filename, you will need to use that format. As mentioned, you can use multiple files as overrides (see docs), by specifying one file per -f argument.

-f 标志是可选的.如果你没有在命令中提供这个标志行,Compose 遍历工作目录及其父目录寻找 docker-compose.yml 和一个的目录docker-compose.override.yml 文件.您必须至少提供docker-compose.yml 文件.如果两个文件都在同一个目录级别,Compose 将两个文件合并为一个配置.

The -f flag is optional. If you don’t provide this flag on the command line, Compose traverses the working directory and its parent directories looking for a docker-compose.yml and a docker-compose.override.yml file. You must supply at least the docker-compose.yml file. If both files are present on the same directory level, Compose combines the two files into a single configuration.

应用docker-compose.override.yml文件中的配置除了 docker-compose.yml 文件中的值.

The configuration in the docker-compose.override.yml file is applied over and in addition to the values in the docker-compose.yml file.

[文档链接]

这篇关于docker-compose.yml 文件命名约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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