docker-compose.yml文件命名约定 [英] docker-compose.yml file naming convention
问题描述
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 ),文件 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屋!