Link to home
Start Free TrialLog in
Avatar of FaheemAhmadGul
FaheemAhmadGulFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Help with an error building a Docker image - failed to read dockerfile: open /var/lib/ ...

I am learning Docker and trying to follow along a tutorial, but getting the following error when I try to build a docker image. 

 => [internal] load build definition from Dockerfile                                                                                                   0.0s    => => transferring dockerfile: 2B                                                                                                                     0.0s   failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount251726823/Dockerfile: no such file or directory
PS C:\Users\drfah\OneDrive\Documents\WPF\nodejs-app-starting-setup>

I am sure that I have correctly named the docker file as Dockerfile and the docker file is in the main project folder. I would appreciate help. User generated image

Avatar of David Favor
David Favor
Flag of United States of America image

Likely I'll get flack for this... sigh...

Windows != Linux

Trying to run Docker or LXD on Windows...

Can it be done? Yes!

Will your Windows Docker Adventure leave you curled up in a fetal position... in a dark corner... contemplating eating your gun? Probably.

If you're learning Docker as a lark, Windows is fine.

If you'd like to boost your income by being a Docker expert, lease a public Linux server for your work.

Take a look at OVH/SoYouStart/KimSifu... all the same company... Price points from $5/USD/month to $1000s/USD/month.

Another tip... Work on Docker/LXD in BASH on the command line, as GUIs tend to obfuscate errors... where you have to go digging through logs, whereas BASH vomits everything to STDOUT/STDERR... so usually... when problems occur, the reason is clear.
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Suggestion: Post the URL of the tutorial you're using.

Might be someone can glance at the tutorial + mention how to fix the problem you're seeing.
Oh... Maybe the problem is this docker build fails to use... OS agnostic paths...

Note the path in question, listing error, is using the Linux "/" separator rather than Windows "\" separator.

I only use Linux + OSX, so unsure how paths might be normalized using Linux Docker config files on Windows.

Tip: Docker... is by no means a trivial system to learn...

If you're learning Docker to increase your income, best use a Linux system for learning.