Docker Create Dockerfile error message

Hallo,
in the course chapter 5 choosing the right base by trying to build a Dockerfile I receive the following error message:
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount4210138664/Dockerfile: no such file or directory

How can I solve this problem?
regards Freddie

Hi,
Can you share the command line you use to use your Dockerfile?
Cheers

Hello
thanks for your reply!
Here comes the command line:
docker build -t react-app .

[+] Building 0.0s (2/2) FINISHED
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 2B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount2698942368/Dockerfile: no such file or directory

I am looking forward hearing from you
freddie

Well I actually though you might have forgotten the ending point because it is one I do quite often.

I am currently working on a project involving docker at work.
I used a Dockerfile and tried the syntax of yours and it works on my end.

I used to learn Docker like a few years back and I also learnt building with build

On my current project I did a bit of research and it happens there is a newer way to build images.

Your error message mentions a file not being found.

Make sure you are running the command from the working directory where the Dockerfile is located. Also check the spelling for Dockerfile.

You can also use the -f parameter explicitly (especially if the name differs from Dockerfile)
For instance

EDIT: Thought it may work locally Docker Hub enforces the user/image naming scheme. So should you push it there the tag you are trying wouldn’t work.

Result:

Hallo
Thank you very much for your hints — now it works
freddie

1 Like