【发布时间】:2020-12-11 07:41:47
【问题描述】:
我是 docker 新手,我正在使用 VSCode 创建新的自定义 alpine docker 映像。以下是我在文件(Dockerfile)中提到的一组命令:
# Step1 specify the base image
FROM alpine
# Download and install dependencies
RUN apk add --update redis
# Setup the startup command
CMD ["redis-server"]
现在,当我在 vs 终端中运行 docker build 命令时,出现错误,
PS C:\Users\ankurpandey\Desktop\StudyMaterial\dockerfile-custom> docker build .
[+] Building 0.1s (2/2) FINISHED
=> [internal] load .dockerignore 0.1s
=> transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> transferring dockerfile: 2B 0.0s
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount460459348/Dockerfile: no such file or directory
我在我的根文件夹 dockerfile-custom 中只创建了一个普通文件,即 Dockerfile如图所示
请告诉我这些步骤出了什么问题?谢谢!!
【问题讨论】:
-
你能展示一下你的 .dockerignore 里有什么吗?
-
能否请您显示当前工作目录(dockerfile-custom)的所有内容?
-
我已经用工作目录的文件夹结构更新了帖子。 @MetallimaX,我在 vscode 更改中没有任何带有 .dockerignore 的文件。
标签: visual-studio docker visual-studio-code dockerfile docker-machine