Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed to solve with frontend dockerfile.v0: failed to read dockerfile?

I am new to Docker and i am trying to create an image from my application, i created Dockerfile in the same directory with package.json file with no extension, just Dockerfile

Now in Dockerfile:

FROM node:14.16.0
CMD ["/bin/bash"]

and i am trying to build the image with that command

docker build -t app .

But i got this constant error:

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

My folder directory is like this:

   |- Dockerfile
   |- README.md
   |- src
   |- package.json
   |- public
   |- node-modules
   |-package-lock.json

My OS is : Windows 10 Pro

like image 356
Saher Elgendy Avatar asked Nov 25 '25 18:11

Saher Elgendy


2 Answers

I encountered a different issue, so sharing as an FYI. On Windows, I created the docker file as DockerFile instead of Dockerfile. The capital F messed things up.

like image 103
gallaleo Avatar answered Nov 27 '25 13:11

gallaleo


Double check that you are in the right directory. I was in downloads/app

When I downloaded the app from Docker as part of their tutorial, I extracted it and it ended up in downloads/app**/app** Type dir in your terminal to see if you can see dockerfile or another folder called app.

like image 32
tedtrux Avatar answered Nov 27 '25 14:11

tedtrux



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!