英文:
docker-compose --env-file unknown flag
问题
今天我更新了 Docker(Docker for Mac)到 4.22.0 版本。
当我尝试执行以下命令时:
docker-compose up --env-file .env.local
我会收到以下错误信息:
未知标志: --env-file
如果我创建一个新文件 .env
,就可以使其工作,但是否有一种方式可以将环境文件作为 docker-compose
的参数传递?
英文:
Today I updated Docker (Docker for Mac) to 4.22.0
When I try to execute
docker-compose up --env-file .env.local
I get
unknown flag: --env-file
I could make it work if I create a new file .env
, but is there a way to pass the env file as an argument of docker-compose
?
答案1
得分: 1
根据官方文档,您应该使用以下命令来指定它:
docker compose --env-file .env.local up
文件路径是相对于执行Docker Compose命令的当前工作目录而言的。
英文:
Following the official documentation you should specify it with the command:
docker compose --env-file .env.local up
The file path is relative to the current working directory where the Docker Compose command is executed.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论