簡體   English   中英

錯誤“無法使用前端 dockerfile.v0 解決”

[英]Error "failed to solve with frontend dockerfile.v0"

I'm building a Docker Image from the Dockerfile on Windows 10. I download the Docker file from here and put in the directory F:\zimtools\Dockerfile .

在此處輸入圖像描述

該文件的內容是

ARG VERSION=
FROM alpine:3
ARG VERSION
LABEL org.opencontainers.image.source https://github.com/openzim/zim-tools
RUN echo "Build image for version: $2021-04-20"

RUN wget -O - -q https://download.openzim.org/nightly/2021-04-20/zim-tools_linux-x86_64-2021-04-20.tar.gz | tar -xz && \
  cp zim-tools*/* /usr/local/bin/ && \
  rm -rf zim-tools*

CMD ["/bin/sh", "-c", "echo 'Welcome to zim-tools! The following binaries are available:' && ls /usr/local/bin/"]

我按照指令在 cmd 中運行以下命令。

docker build --tag=“zimtools:nightly” "F:\zimtools\Dockerfile"

然后我得到一個錯誤

C:\Users\Akira>docker build --tag="zimtools:nightly" "F:\zimtools\Dockerfile"
[+] Building 0.0s (1/2)
 => ERROR [internal] load build definition from Dockerfile                                                         0.0s
 => => transferring dockerfile: 75B                                                                                0.0s
------
 > [internal] load build definition from Dockerfile:
------
failed to solve with frontend dockerfile.v0: failed to read dockerfile: error from sender: walk F:\zimtools\Dockerfile: The system cannot find the path specified.

你能解釋一下如何解決這個錯誤嗎?

更新:我的設置是

  • Docker 引擎:v20.10.5

  • 操作系統:Windows 10 Pro,版本 20H2,內部版本 19042.928。

要構建您的 docker 映像:

  1. cddockerfile所在的路徑(在你的情況下是F:\zimtools\
  2. docker build.

這類似於此命令docker build -f Dockerfile.

僅當Dockerfile名稱不是默認名稱時,您才需要指定它:

  1. cddockerfile所在的路徑(在你的情況下是F:\zimtools\

  2. docker build -f <your modified docker file>.

我面臨着類似的問題。 幫助我的是在主目錄中創建另一個子文件夾並將 dockerfile 移動到其中。

看到這個

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM