无法部署Dockerfile:path / to / Dockerfile':ADD temp / path / to / app ::失败,没有这样的文件或目录

时间:2018-12-26 07:09:54

标签: docker ubuntu dockerfile webstorm

我正在尝试在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" ]

免责声明:

我尝试了一些给定的修复程序,

此处:ADD failed : No such file/Directory while building docker image

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

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

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

1 个答案:

答案 0 :(得分:1)

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