我不能把我的 Dockerfiles 叫做别的东西
I cant call my Dockerfiles something else
我的代码解决方案包含共享项目、Web 前端和 Web api 项目。由于 Dockerfile 无法访问父文件夹,因此 Dockerfile 需要位于我认为的根文件夹中(前端和 api 都依赖于共享)。
所以我有 Dockerfile.api 如果我有 1.8 或更高版本 (https://github.com/moby/moby/wiki),这是允许的。我有,我有最新的 4.2
调用Dockerfile(web api)成功,但是调用docker build -f Dockerfile.api
出现这个错误:
"docker build" requires exactly 1 argument.
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
我在这里错过了什么?由于我的 repo 包含不同的项目,这将导致不同的图像,我想要不同的 Dockerfile,并且由于依赖关系,它们需要位于根目录。
docker build 需要有一个路径参数,其中应该执行构建。
所以正确的命令是:
docker build -f Dockerfile.api .
我的代码解决方案包含共享项目、Web 前端和 Web api 项目。由于 Dockerfile 无法访问父文件夹,因此 Dockerfile 需要位于我认为的根文件夹中(前端和 api 都依赖于共享)。
所以我有 Dockerfile.api 如果我有 1.8 或更高版本 (https://github.com/moby/moby/wiki),这是允许的。我有,我有最新的 4.2
调用Dockerfile(web api)成功,但是调用docker build -f Dockerfile.api
出现这个错误:
"docker build" requires exactly 1 argument.
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
我在这里错过了什么?由于我的 repo 包含不同的项目,这将导致不同的图像,我想要不同的 Dockerfile,并且由于依赖关系,它们需要位于根目录。
docker build 需要有一个路径参数,其中应该执行构建。
所以正确的命令是:
docker build -f Dockerfile.api .