docker-compose –env-file 未知标志

huangapple go评论72阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年8月4日 07:01:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76832059.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定