Error "failed to solve with frontend dockerfile.v0"

Viewed 18931

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.

enter image description here

The content of the file is

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/"]

I follow this instruction and run below command in cmd.

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

Then I got an error

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.

Could you please explain how to solve this error?

Update: My setup is

  • Docker Engine: v20.10.5

  • OS: Windows 10 Pro, version 20H2, build 19042.928.

2 Answers

To build your docker image:

  1. cd to your path where the dockerfile is (In your case it's F:\zimtools\)
  2. docker build .

This is similar to this command docker build -f Dockerfile .

You need to specify the Dockerfile name only when it's not default:

  1. cd to your path where the dockerfile is (In your case it's F:\zimtools\)

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

I was facing a similar issue. What helped me was creating another subfolder in the home directory and moving the dockerfile into that.

See this

Related