当我指定文件时,"docker-compose build"会向我显示帮助文本

pet*_*urg 2 yaml docker docker-compose

在构建期间指定撰写文件时:

docker-compose build -f compose-production.yml

图像不会构建,而是显示帮助文本:

$ docker-compose build -f compose-production.yml 
Build or rebuild services.

Services are built once and then tagged as `project_service`,
e.g. `composetest_db`. If you change a service's `Dockerfile` or the
contents of its build directory, you can run `docker-compose build` to rebuild it.

Usage: build [options] [SERVICE...]

Options:
    --force-rm  Always remove intermediate containers.
    --no-cache  Do not use cache when building the image.
    --pull      Always attempt to pull a newer version of the image.
Run Code Online (Sandbox Code Playgroud)

谁知道发生了什么?

Sla*_*ski 9

运行:

docker-compose -f compose-production.yml build
Run Code Online (Sandbox Code Playgroud)

-f是选择docker-compose的命令没有选项build