Buildx: 'docker build' error: "failed to solve with frontend dockerfile.v0"

Created on 15 Oct 2020  路  74Comments  路  Source: docker/buildx

  • [x] I have tried with the latest version of my channel (Stable or Edge)

    • [x] I have uploaded Diagnostics

    • Diagnostics ID: DAA27533-4D93-4AF4-916C-8492CC6BF66B/20201015121621

Expected behavior

I expect to build a docker image from my Dockerfile for my R Shiny application.

Actual behavior

I get the resulting error from the docker build command:
Capture

Information

Docker version is:
Capture

Windows Version: Windows 10 Home, version 1909

And docker run hello-world does work as expected:
Capture

I'm working with Docker Desktop for Windows 10 Home and I've followed this guide for the installation:
Install Docker Desktop on Windows Home

Since I think I have followed the guide correctly, and passed the docker run hello-world test, I'm not sure how to begin debugging this error.

I would really appreciate any help on clarifying what the error means, and how to potentially address it. Thank you!

Most helpful comment

Name the file Dockerfile exactly. I got the same error because i named it DockerFile

All 74 comments

Thanks for the report, moving to buildx repository.

Please post docker version and a reproducer. Also, check if there is anything interesting in the daemon logs.

@tonistiigi my docker version is:
Capture

Also, by reproducer, do you mean a reproducible example?

And for the daemon logs you suggested, I'm not sure if I have been able to locate them correctly. I followed the advice here on where to find them (on my Windows it was under AppData\Local\Docker and I found this log.txt file.

I looked through the log.txt file but I couldn't find anything helpful.

Is this the correct file? And did I miss something important within it?

I noticed this as well with the same version after the update.

Fixed after I purged the settings and restarted.

Name the file Dockerfile exactly. I got the same error because i named it DockerFile

changing name 'Dockerfile' from 'dockerfile' also worked for me

@UlasKasim @ArifIstaka the name of the file is already capitalized.
Capture

@Muqito Can you clarify a little bit on how you "purged the settings and restarted." Thanks!

@nromagno Sure thing.

Click on this little bug icon up to the right, and then you'll see the following settings:

purge-and-reset

I think I might have also reset to factory settings. Not sure though

@Muqito I purged the data and restarted as you described, but unfortunately the same error still appears.

@stephen-turner, @tonistiigi, @nromagno, Good afternoon! I am new to Docker. I try to run the image and container based on it by reading the Microsoft documentation step by step:
https://docs.microsoft.com/ru-ru/dotnet/core/docker/build-container?tabs=windows
But if I specify a Dockerfile without an extension, then I encounter an error reading Dockerfile by Docker itself (for some reason, it does not see the Dockerfile in this directory). When I specify the .txt extension (docker build -t counter-image -f Dockerfile.txt .
), Docker sees this file:
docker-error 5
docker-error 6
docker-error 8
docker-error 7

So do I not understand something due to lack of experience, or is there really some problem?

 Best regards, Kusanagi-2029

I just hit the same issue. I use the WSL2 engine, which is of course case-sensitive. The command sent to docker from Visual Studio is specifying a fully lowercase path, which breaks the command of course.

I just hit the same issue. I use the WSL2 engine, which is of course case-sensitive. The command sent to docker from Visual Studio is specifying a fully lowercase path, which breaks the command of course.

Same here. Visual Studio debugging with Docker works fine. Output window shows:
>docker build -f "C:\dev\src\Project.Name\Dockerfile" args...
But building from the context menu when right clicking on the Dockerfile in the solution explorer executes this:
>docker build -f "c:\dev\src\project.name\dockerfile" args...

This may help someone else:
The instructions say to make sure you are in the directory "node-bulletin-board/bulletin-board-app" and I was getting the above error when running in "node-bulletin-board". Changed into the bulletin-board-app child directory and it ran. Naturally I only re-read the doc after trying everything else.

Simply change name of "dockerfile" to "Dockerfile" and then build, it works for me.

These reports seem to be unique for windows. Afaics NTFS is a case-sensitive filesystem so I'm not sure how having Dockerfile in the wrong case producing an error could be a regression and not just an expected result. If someone can show the exact reproduction steps that show something that previously worked not working anymore in buildx it is possible we could do something about it or improve documentation.

edit: reading some more, apparently case-sensitivity is optional in NTFS (and some modern Windows don't use NTFS anymore). Assuming that is the underlying issue some investigation needs to be made why it worked previously (if it is a regression). It think it may be possible to have some exception to keep it working in buildx.

I don't know if it's a regression from old build, but I would say that it's highly unexpected for dockerfile and Dockerfile to behave differently on a typical Windows machine.

image
even the tutorial in a fresh Docker Desktop installation fails...

Same here:
failed to solve with frontend dockerfile.v0: failed to build LLB:
$ docker --version
Docker version 19.03.13, build 4484c46d9d

I don't know if it's a regression from old build, but I would say that it's highly unexpected for dockerfile and Dockerfile to behave differently on a typical Windows machine.

It's not too unexpected as I'm 99% sure that if you would just create a tarball of your build context and send it to the daemon (simplified version on how the API works) it would fail with any version of the builder. There is some preprocessing specifically for this file and that's why the casing is masked. For any other file referred to in Dockerfile no such exception exists as well. These are all linux container builds that are referred here and (common) Linux filesystems are case sensitive.

Same here:
failed to solve with frontend dockerfile.v0: failed to build LLB: error from sender: context created
Docker version:
Docker version 19.03.13, build 4484c46d9d

The Dockerfile is named "Dockerfile". I have also tried purging and restarting but the issue persists.

@tonistiigi file name is not the only issue here, or I have just another bug

Here is what I face when running docker build command:

failed to solve with frontend dockerfile.v0: failed to build LLB: failed to load cache key: rpc error: code = Unknown desc = error getting credentials - err: exec: "docker-credential-desktop.exe": executable file not found in $PATH, out: ``

Renaming "credsStore": "desktop.exe" to "credStore": "desktop.exe" in ~/.docker/config.json is what helped me actually, but it seems like Docker Destkop keeps adding credsStore entry in that config file

image
even the tutorial in a fresh Docker Desktop installation fails...

I had this same problem.
Just Sgin in in your Docker account

@llwydsj can you expand a little bit on your comment and the how you suggested to resolve this issue? I'm not familiar with Visual Studio, so how could I check if my issue also arises from case sensitivity. Thanks!

I did some digging and it turned out this was not even caused by the case-sensitivity of the filesystem. There is a special fallback https://github.com/moby/moby/pull/10858 that allows name dockerfile when loading Dockerfile fails. It is only valid for dockerfile name, eg. dockerfilE will not work.

I've provided patches in buildx https://github.com/docker/buildx/pull/444 and also in Dockerfile frontend in Buildkit https://github.com/moby/buildkit/pull/1816 to maintain compatibility. Only one of them is needed to have the old behavior back.

Rename dockerfile to Dockerfile. Doing this fixed my issue.

I had the same issue (on a Mac). running a test from my home directory /Users/norm
failed to solve with frontend dockerfile.v0: failed to build LLB: error from sender: open .Trash: operation not permitted

I moved the Dockerfile out of my home directory into a subdirectory (/Users/norm/test/) and was able to build without the above error when executed from /Users/norm/test/. Seems permission related`

I moved the Dockerfile out of my home directory into a subdirectory (/Users/norm/test/) and was able to build without the above error when executed from /Users/norm/test/. Seems permission related`

Yes, that situation is expected; always start builds from a directory that only contains files that you need for your build.

When you run docker build ., the last . is the path of the "build context" (in case of a . that's the current directory). Running a build will send the build context and all files and subdirectories to the daemon, so that they can be used as part of your build (sending your entire home directory is likely not what you want 馃槄)

Buildkit is smarter in that it only sends files that are used by a COPY or ADD instruction in your Dockerfile, but it may still scan the directory for file changes (and in your case run in permission issued)

changing name 'Dockerfile' from 'dockerfile' also worked for me

Hello,
Where can I find this file?
I'm trying on a Mac and Windows computer and is the same error and I cannot find that file.

Thanks.

The Dockerfile is a file you create yourself if you want to build an image: https://docs.docker.com/get-started/part2/

changing name 'Dockerfile' from 'dockerfile' also worked for me

Funny, for me the fix is the other way round....I don't think we have found the culprit yet

Apparently this issue (or at least the one I'm experiencing) is already known with the visual studio people and the fix is pending release: https://developercommunity.visualstudio.com/content/problem/1192625/build-docker-image-failing-because-of-lowercased-d.html

Hi, I had the same issue and I could finally solve it by disabling buildkit feature as explained here: https://stackoverflow.com/questions/64382812/docker-has-the-same-error-regardless-of-what-i-try-to-build-windows-10

Hi, I had the same issue and I could finally solve it by disabling buildkit feature as explained here: https://stackoverflow.com/questions/64382812/docker-has-the-same-error-regardless-of-what-i-try-to-build-windows-10

Worked for me, thanks

The lowercase dockerfile issue will be fixed by https://github.com/docker/buildx/pull/444, which adds a fallback to check both for Dockerfile and dockerfile for backward-compatibility with the classic builder, which had that fallback in place. (note that other cases, such as dOCkerFile _won't_ be supported

Note that other errors starting with failed to solve with frontend dockerfile.v0 may be unrelated; the failed to solve.. prefix is a generic prefix for this part of builds, and the errors _after that_ are the underlying error, so if you run into another issue and think it's a bug, please open a new ticket instead.

Details:
Windows 10 Pro
Docker version : 19.03.13
I try to change the name:
Dockerfile.dockerfile
I delete ".dockerfile"... so
"dockerfile" not extension... It's working now...

@stephen-turner, @tonistiigi, @nromagno, Good afternoon! I am new to Docker. I try to run the image and container based on it by reading the Microsoft documentation step by step:
https://docs.microsoft.com/ru-ru/dotnet/core/docker/build-container?tabs=windows
But if I specify a Dockerfile without an extension, then I encounter an error reading Dockerfile by Docker itself (for some reason, it does not see the Dockerfile in this directory). When I specify the .txt extension (docker build -t counter-image -f Dockerfile.txt .
), Docker sees this file:
docker-error 5
docker-error 6
docker-error 8
docker-error 7

So do I not understand something due to lack of experience, or is there really some problem?

 Best regards, Kusanagi-2029

I have encountered the same problem after some searching I luckily found that using Dockerfile with Extention will do the trick
Instead of Doing this
docker build -t hello-world -f Dockerfile .
I changed this to
docker build -t hello-world -f Dockerfile .txt .

So I was having this problem on my mac, and it turns out that there was a docker temp file in the current folder. Deleting it solved it. Here's the error and the file in question :

Exception :
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to build LLB: Error processing tar file(exit status 1): unexpected EOF

File :
-rw------- 1 rlavoie 1177235957 2428567552 4 Dec 00:10 .docker_temp_499366070

Same error here, when is there a solution ? Kubernetes, docker and visual studio 2019..a lot of bugs and weird things. Can it become a steady working environment to work in?

@V4A001 what is "same error"? If it's because of a lowercase dockerfile, rename the file to Dockerfile to fix the problem. "lots of bugs and weird things" is not very helpful; also see https://github.com/docker/buildx/issues/415#issuecomment-737279041

Note that other errors starting with failed to solve with frontend dockerfile.v0 may be unrelated; the failed to solve.. prefix is a generic prefix for this part of builds, and the errors _after that_ are the underlying error, so if you run into another issue and think it's a bug, please open a new ticket instead.

It seems OO-design is lacking with throws same bug at various places? If I use in VS 2019 the debugger to build a docker images that works fine with Docker file (capital first letter). If I right click on the Docker file and do 'Build Docker Image' it fails see below. If I change to lower caps it builds.

`
8>failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount840562661/dockerfile: no such file or directory
8>d:projects-dockerfile : error CTC1014: Docker command failed with exit code 1.
8>d:projects-dockerfile : error CTC1014: #1 [internal] load .dockerignore
8>d:projects-dockerfile : error CTC1014: #1 transferring context: 35B done
8>d:projects-dockerfile : error CTC1014: #1 DONE 0.0s
8>d:projects-dockerfile : error CTC1014:
8>d:projects-dockerfile : error CTC1014: #2 [internal] load build definition from dockerfile
8>d:projects-dockerfile : error CTC1014: #2 transferring dockerfile: 2B done
8>d:projects-dockerfile : error CTC1014: #2 DONE 0.0s
8>d:projects-dockerfile : error CTC1014: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount840562661/dockerfile: no such file or directory

`

Hi, I had the same issue and I could finally solve it by disabling buildkit feature as explained here: https://stackoverflow.com/questions/64382812/docker-has-the-same-error-regardless-of-what-i-try-to-build-windows-10

Worked for me, thanks

Worked for me as well, many thanks

@V4A001

failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount840562661/dockerfile: no such file or directory

When you mention "If I right click on the Docker file and do 'Build Docker Image' it fails see below. If I change to lower caps it builds."; is the Dockerfile your building named Dockerfile or dockerfile?

Note that the while fix in buildx that was merged is on "master", it's not in a released version yet. I also don't know how the Build Docker Image option is implemented in VScode, which could play a role here.

The debugger of debugger itself works with Dockerfile
The right click on the file to build the image only works if the file is dockerfile

Hi, I had the same issue and I could finally solve it by disabling buildkit feature as explained here: https://stackoverflow.com/questions/64382812/docker-has-the-same-error-regardless-of-what-i-try-to-build-windows-10

I tired this and it finally worked! thanks!

I tried many options but unfortunately didn't helped, and I realized that my Dockerfile was mistakenly inside /app/src, moved Dockerfile back to root, and it just WORKED!! 馃挴

FROM node:latest

RUN mkdir -p /app/src

WORKDIR /app/src

COPY package.json .

RUN npm install

COPY . .

EXPOSE 3000

CMD ["npm", "start"]

Hi, I had the same issue and I could finally solve it by disabling buildkit feature as explained here: https://stackoverflow.com/questions/64382812/docker-has-the-same-error-regardless-of-what-i-try-to-build-windows-10

this worked for me. thanks!

It only appears to only break if I attempt to cross-build for an architecture such as armv7 or anything that isn't x86/64

I had that issue on my mac as well

on macOS renaming "DockerFile" to "dockerfile" fixed the problem for me.

My file was named "Dockerfile" and building only for amd64 with the default build system worked fine. When I used buildx to build for a different architecture it would error out.

Another situation that I encountered was that .dockerignore was blocking the COPY . For example:

dockerfile:

FROM nginx:1.19.6-alpine as nginx
COPY ./Build/release/authenticator/conf/nginx.conf /etc/nginx/conf.d/default.conf

error:

failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = failed to build LLB: failed to compute cache key: "/Build/release/authenticator/conf/nginx.conf" not found: not found

The solution was to add !/Build/release/authenticator/conf/nginx.conf in .dockerignore

@tonistiigi file name is not the only issue here, or I have just another bug

Here is what I face when running docker build command:

failed to solve with frontend dockerfile.v0: failed to build LLB: failed to load cache key: rpc error: code = Unknown desc = error getting credentials - err: exec: "docker-credential-desktop.exe": executable file not found in $PATH, out: ``

Renaming "credsStore": "desktop.exe" to "credStore": "desktop.exe" in ~/.docker/config.json is what helped me actually, but it seems like Docker Destkop keeps adding credsStore entry in that config file

Crazy, this worked for me. Thanks!

Win 10 Pro WSL2 Ubuntu 20.04

Renaming credsStore to credStore would be the equivalent to _removing_ the credsStore config (which makes docker skip the credentials-helper, and to store credentials as base64 encoded plain text in the configuration file).

restarting docker worked for me

Deleting docker config file from inside WSL2 Ubuntu shell fixed it for me:

rm ~/.docker/config.json

I'm using Windows 10.

My issue was regarding the permissions to download the FROM image

I ran the docker build command as following:

sudo docker build -t myapp .

Also the docker file was named 'Dockerfile'

That worked for me

Well, docker message is confusing.
In my case I just used invalid working directory (so I just have to cd to the right subdir with my Dockerfile).

Instead of explaining message like "No Dockerfile found, looked at current working directory /foo/bar" on my docker build --no-cache --tag jaroslavtyc/pb-web:8.0 . command I saw

[+] Building 0.0s (2/2) FINISHED                                                                                                                                                                                                        
 => [internal] load build definition from Dockerfile                                                                                                                                                                               0.0s
 => => 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-mount710040659/Dockerfile: no such file or directory

Window 10 Home restart worked for me
Screenshot (79)

For anyone stumbling across this issue on mac...
failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = failed to parse /Users/myusername/.docker/.token_seed: unexpected end of JSON input

I just deleted .token_seed and .token_seed.lock inside of /Users/myusename/.docker

@mariusdkm could you open a new ticket for that?

Great..

$ docker build . -t spa-react:1.0
[+] Building 12.0s (8/12)
 => [internal] load build definition from Dockerfile                                                                                                                               0.9s 
 => => transferring dockerfile: 552B                                                                                                                                               0.0s 
 => [internal] load .dockerignore                                                                                                                                                  0.6s 
 => => transferring context: 2B                                                                                                                                                    0.0s 
 => [internal] load metadata for docker.io/library/nginx:1.19.6                                                                                                                    0.0s 
 => [internal] load metadata for docker.io/library/node:15.8.0                                                                                                                     0.0s 
 => [node-server 1/5] FROM docker.io/library/node:15.8.0                                                                                                                           0.0s 
 => ERROR [internal] load build context                                                                                                                                           11.0s 
 => => transferring context: 81.80MB                                                                                                                                              10.8s 
 => CACHED [client-app 1/2] FROM docker.io/library/nginx:1.19.6                                                                                                                    0.0s 
 => CACHED [node-server 2/5] WORKDIR /usr/src/app                                                                                                                                  0.0s 
------
 > [internal] load build context:
------
failed to solve with frontend dockerfile.v0: failed to build LLB: error from sender: open node_modules\eslint-plugin-testing-library\node_modules\@typescript-eslint\experimental-utils\_ts3.4\dist\ts-eslint-scope: Access is denied

@JesielPalacios looks unrelated; from the error it looks like you don't have permissions to read a file in your build context;

error from sender:
open node_modules\eslint-plugin-testing-library\node_modules\@typescript-eslint\experimental-utils\_ts3.4\dist\ts-eslint-scope:
Access is denied

see https://github.com/docker/buildx/issues/415#issuecomment-737279041

Note that other errors starting with failed to solve with frontend dockerfile.v0 may be unrelated; the failed to solve.. prefix is a generic prefix for this part of builds, and the errors _after that_ are the underlying error,

@thaJeztah Mm.. i think that's weird, cause i'm working like administrator user and just trying to deploy an Angular App using the Multi-Stage Build feature from Docker.
I gonna need to get mor info on the internet about how to do it. If you got some info about it i'll be so gratefull to know it. Thanks!

If you're working on wsl2 environment this worked for me: wsl --shutdown

For anyone stumbling across this issue on mac...
failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = failed to parse /Users/myusername/.docker/.token_seed: unexpected end of JSON input

I just deleted .token_seed and .token_seed.lock inside of /Users/myusename/.docker

@mariusdkm life saver! thank you.

@tonistiigi file name is not the only issue here, or I have just another bug

Here is what I face when running docker build command:

failed to solve with frontend dockerfile.v0: failed to build LLB: failed to load cache key: rpc error: code = Unknown desc = error getting credentials - err: exec: "docker-credential-desktop.exe": executable file not found in $PATH, out: ``

Renaming "credsStore": "desktop.exe" to "credStore": "desktop.exe" in ~/.docker/config.json is what helped me actually, but it seems like Docker Destkop keeps adding credsStore entry in that config file

This was my issue as well. Running Docker Desktop on WSL2. I just changed credsStore to credStore, so I haven't seen yet if it gets changed back, but I'll update here if it happens to me too. Seems like #444 didn't fix this issue entirely since credsStore vs credStore wasn't addressed in that PR.

  • Docker version 20.10.5, build 55c4c88
  • Windows 10 Pro Insider Preview, Build 21332.rs_prerelelease.210306-1859

I was having the "failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials" issue under Docker Desktop Windows/WSL2.

Running with sudo worked for me.

Estoy siguiendo los pasos para usar Docker y me salta este error al ejecutar el comando : docker build -t captacion-php ./

[+] Building 0.3s (2/2) FINISHED
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 4: unknown instruction: LIBMCRYPT-DEV

驴me ech谩is una mano? gracias!

If i run docker build with build kit (DOCKER_BUILDKIT=1 docker build -t base .), the error occurs.
I simply remove that params (docker build -t base .) and its works.

in my case adding tag after image name resolved the issue.
FROM nginx to FROM nginx:latest

Was this page helpful?
0 / 5 - 0 ratings