部署 Dockerfile 失败:path/to/Dockerfile': 添加失败 temp/path/to/app :: 没有这样的文件或目录

Failed to deploy Dockerfile: path/to/Dockerfile': ADD failed temp/path/to/app :: no such file or directory

我正在尝试 运行 我在 Ubuntu 18.0.4 机器上使用 Webstorm 从 https://github.com/aws-samples/ecs-refarch-cloudformation 克隆的 Dockerfile。当我尝试 运行 ./services/product-service/src/Dockerfile 时,出现如下错误。

Step 5/6 : ADD app /app

Error: ResponseItem.ErrorDetail[code=<null>,message=ADD failed: stat /var/lib/docker/tmp/docker-builder865139225/app: no such file or directory]
Failed to deploy '<unknown> Dockerfile: services/product-service/src/Dockerfile': ADD failed: stat /var/lib/docker/tmp/docker-builder865139225/app: no such file or directory

下面给出的是 Dockerfile

# Start from a small base
FROM scratch

# Our application requires no privileges
# so run it with a non-root user
ADD users /etc/passwd
USER nobody

# Our application runs on port 8001
# so allow hosts to bind to that port
EXPOSE 8001

# Add our application binary
ADD app /app

# Run our application!
ENTRYPOINT [ "/app" ]

免责声明:

我尝试了一些修复,

此处:

此处:https://github.com/goreleaser/goreleaser/issues/694

此处:https://github.com/docker/for-win/issues/1859

其中一些与我的案例无关。

我刚刚在 ../src 中创建了一个目录 app 目录,并在 Dockerfile 中注释掉了 USER nobody 行,看起来工作正常。