Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount587080174/Dockerfile: no such file or directory #8781

Closed
2 tasks
SHAMBHU1995 opened this issue Oct 2, 2020 · 30 comments

Comments

@SHAMBHU1995
Copy link

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID:

Expected behavior

Actual behavior

Information

  • Windows Version:
  • Docker Desktop Version:
  • Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM:

Steps to reproduce the behavior

  1. ...
  2. ...
@docker-robott
Copy link
Collaborator

We're closing this issue because it doesn't contain enough information for us to investigate the problem.
If you'd like us to investigate further, could you please open a fresh issue with a more detailed description of the problem and a diagnostic id, following the steps at https://docs.docker.com/docker-for-windows/troubleshoot?

@brotherspenti
Copy link

your docker file name should be "Dockerfile", i also faced same issue struggled lot of time, my file was as "dockerfile" so renamed it to "Dockerfile", then issue got resolved.

@dstowe
Copy link

dstowe commented Oct 7, 2020

I had this problem with the tutorial, I was running downloaded files from desktop. I moved the files to c: drive and all is well!

karlbaker02 pushed a commit to karlbaker02/lambda-native-package-builder that referenced this issue Nov 2, 2020
This commit renames the `dockerfile`s to `Dockerfile`s because Docker 2.4 seems to have issues finding the former (ref: docker/for-win#8781).
@maritamayman
Copy link

Hi!
Make sure your dockerfile has the same name as the one shown in your terminal, example:

failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount320670870/Dockerfile: no such file or directory

In this case, your dockerfile´s name should be DockerFile

The dockerfile needs no extension, in Windows, you can create it with notepad++ and save it as "all types (.)"

You can try typing the full path of your dockerfile:

docker build -t X:X O:\Users\yyy\XX

@BhadraJayakumarSandhya
Copy link

tried all these and still not working

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

any ideas how to resolve this?

@jbvazquez
Copy link

your docker file name should be "Dockerfile", i also faced same issue struggled lot of time, my file was as "dockerfile" so renamed it to "Dockerfile", then issue got resolved.

Thank's it solved my issue

@Frozendan1
Copy link

Hi!
Make sure your dockerfile has the same name as the one shown in your terminal, example:

failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount320670870/Dockerfile: no such file or directory

In this case, your dockerfile´s name should be DockerFile

The dockerfile needs no extension, in Windows, you can create it with notepad++ and save it as "all types (.)"

You can try typing the full path of your dockerfile:

docker build -t X:X O:\Users\yyy\XX

^^ Thanks for this. I realized my unzip program put the code extract in downloads\app\app and my Docker file referenced \app as the directory (hence getting the failed to read message). Upon correcting it, everything is working.

@1nnikan1
Copy link

how to create a Dockerfile

@fanpero87
Copy link

your docker file name should be "Dockerfile", i also faced same issue struggled lot of time, my file was as "dockerfile" so renamed it to "Dockerfile", then issue got resolved.

Hello,
I'm sorry to ask but where is that Dockerfile located?
I just installed the Mac Desktop version and have the same problem.
Thanks.

@fanpero87
Copy link

Hello,
I keep reading that we should rename the Dockerfile but I honestly don't know what file is that or where to find it. A little help is much appreciated.

This is the error:
fanpero@Amis-MacBook-Pro Docker % docker build --tag hello-world . [+] Building 0.0s (2/2) FINISHED => [internal] load build definition from Dockerfile 0.0s => => 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-mount813481497/Dockerfile: no such file or directory fanpero@Amis-MacBook-Pro Docker %

Thanks.

@Frozendan1
Copy link

If you're following along in the Getting Started instructional tutorial, you should have downloaded the app. There should be an app directory. For me, I just unzipped the file into my downloads folder. Go to your code editor (I'm using Visual Code) and open the app directory. You should see the Dockerfile just under the app folder. If you don't see a Dockerfile, you're instructed to create one.

@Bijan-mp
Copy link

Bijan-mp commented Dec 3, 2020

I just logged in to Docker app and the problem solved !!

@Rushanf
Copy link

Rushanf commented Dec 10, 2020

Filename must be "Dockerfile" and file type must be "File"

@nainesh72
Copy link

your docker file name should be "Dockerfile", i also faced same issue struggled lot of time, my file was as "dockerfile" so renamed it to "Dockerfile", then issue got resolved.

Thank's it solved my issue

Thanks you are 100 sure i change mu file name DockerFile to Dockerfile it working

@niyankhadka
Copy link

Problem was similar to me.... i tried same thing which was mentioned above. I tried changing file name and checked whether there was any extension or not. Here is the first error to me where screenshot is attached below from vscode :
vscodescreenshot

Then after wards, i stopped building from vscode and opened terminal and same build code works for me. Screenshot is attached below:

powershellscreenshot

I think, this might help some people who are stuck with this one. This is how i solved my problem in Windows 10.

@josephhailu
Copy link

josephhailu commented Jan 5, 2021

on win 10 i had to try
docker build -t getting-started ./app

@bakhalea
Copy link

I faced below error:
image
image

@ileuskov
Copy link

ileuskov commented Jan 17, 2021

I had the same problem and this is my solution to it:
I had the app in Portfolio/Docker/techworld-js-docker-demo-app/app. The source code of the app was in the app. So I was trying to build my app from there and had this problem

After I moved one folder back to the main folder of the app techworld-js-docker-demo-app and run docker build -t my-app:1.0 everything worked out fine!

I should also say that techworld-js-docker-demo-app is exactly where my Dockerfile was. So the problem for me was that I was trying to build an app from the src folder where there was no Dockerfile instead of running it from the folder where it was stored

@narendrasingh86
Copy link

tried all these and still not working

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

any ideas how to resolve this?

Please ensure you are in the correct directory where your Dockerfile is present.

@narendrasingh86
Copy link

Please ensure you are in the correct directory where your Dockerfile is present.

@vadimzozulya
Copy link

I have DOCKERFILE file, and after the recent update of the docker desktop docker build . command started failing with the same error.
Adding -f : docker build -f .\DOCKERFILE . solved the issue for me.

@bxj121
Copy link

bxj121 commented Jan 27, 2021

I have DOCKERFILE file, and after the recent update of the docker desktop docker build . command started failing with the same error.
Adding -f : docker build -f .\DOCKERFILE . solved the issue for me.

This worked for me . Thanks

@lcarloscosta88
Copy link

Problem was similar to me.... i tried same thing which was mentioned above. I tried changing file name and checked whether there was any extension or not. Here is the first error to me where screenshot is attached below from vscode :
vscodescreenshot

Then after wards, i stopped building from vscode and opened terminal and same build code works for me. Screenshot is attached below:

powershellscreenshot

I think, this might help some people who are stuck with this one. This is how i solved my problem in Windows 10.

Thanks bro! It worked for me this way too. I'm using Mac BigSur, in VsCode I was getting the same issue, in Mac shell it worked fine.

@iblezya
Copy link

iblezya commented Feb 18, 2021

I have DOCKERFILE file, and after the recent update of the docker desktop docker build . command started failing with the same error.
Adding -f : docker build -f .\DOCKERFILE . solved the issue for me.

I had this problem in WSL. Thanks worked for me.

@1Mark
Copy link

1Mark commented Feb 21, 2021

Make sure that the Dockerfile is in the same directory that you run docker build -t tagName . and in the root of your project.
My issue is that I accidentally had put it inside the src folder. Instead your project should look something like this
image

@bigdevlarry
Copy link

@1Mark thank you solved for me . It means you have to be in the root directory where you have the Dockerfile . Sweet

@aloyst
Copy link

aloyst commented Mar 7, 2021

Sounds really silly, but I was also experiencing this issue and the above was not resolving.
Turns out it was my fault, make sure you don't make the same mistake I was and not having my terminal in the correct directory in the first place:
C:\Users\xxx\Documents### \app
Soon as I entered this directory, and followed the other steps posted above to resolve filename/extension issues etc. the build ran successfully.

@fsteig2002
Copy link

Please ensure you are in the correct directory where your Dockerfile is present.

@ashibindal22
Copy link

Sounds really silly, but I was also experiencing this issue and the above was not resolving.
Turns out it was my fault, make sure you don't make the same mistake I was and not having my terminal in the correct directory in the first place:
C:\Users\xxx\Documents### \app
Soon as I entered this directory, and followed the other steps posted above to resolve filename/extension issues etc. the build ran successfully.

Thank you! i made the same silly mistake

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests