An error, "failed to solve with frontend dockerfile.v0"
Asked Answered
T

57

385

I was trying to build my Docker image for my Gatsby application. Whenever I run the command docker build . -t gatsbyapp, it gives me an error:

failed to solve with frontend dockerfile.v0: failed to build LLB:
failed to compute cache key: "/.env" not found: not found

Meanwhile my Dockerfile is shown below:

FROM node:13

WORKDIR /app

COPY package.json .

RUN yarn global add gatsby-cli

RUN yarn install

COPY gatsby-config.js .

COPY .env .

EXPOSE 8000

CMD ["gatsby","develop","-H","0.0.0.0"]
Threat answered 6/10, 2020 at 8:14 Comment(5)
I'm VTC this question as needs more focus. There are lots and lots of reasons why you may be getting this error, look at the multiple completely different answers below.Torero
This question needs more detail. does the .env file actually exist or not?Chassidychassin
One of the reasons can be permission of the docker file. Folks getting error also check for error message, "SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permi ssions for sensitive files and directories."Detoxicate
I too faced the problem. I forgot to save the Dockerfile after copy the example content to the file window in vscode, once the Dockerfile is saved , the error Dockerfile can not be empty error gone and it worked.Summit
If this helps anyone, make sure your build > context option is set to ./ or something meaningful. I was getting this error because I had inadvertently typed .. there.Deedradeeds
L
274

I had the same issue and all I had to do was to capitalize the Docker configuration filename:

dockerfile > didn't work

Dockerfile > did work

Luehrmann answered 21/10, 2020 at 17:34 Comment(5)
If you do not specify a docker file with the -f option, it searches for the default file "Dockerfile" in the current path. With "docker build -f dockerfile" you can choose which file is the docker fileDegradable
This pointed me in the right direction. Windows had added ".txt" to my Dockerfile. Removed that and problem solved.Mccune
It is a good practice to always use -f ./Dockerfile in the build commandRainwater
I created a Dockerfile using text edit and it by default gives an extension : .rtf. But the mac was not showing the extension. So please make sure the Dockerfile has no hidden extensions...Gash
if use docker-compose set dockerfile: to Dockerfile in docker-compose.yaml fileLepley
C
451

I had experienced this issue after upgrading to the latest Docker Desktop version on Mac. Solved with the comment on this issue.

Solution: Don't use buildkit and it works for me.

export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0
Curry answered 18/3, 2021 at 16:32 Comment(8)
Or DOCKER_BUILDKIT=0 docker build ...Hoicks
If someone facing the issue with docker desktop 3.6.0 and docker engine v 20.10.8 in Windows 10 OS. I set the buildkit flag (at settings=> docker engine =>features json node => buildkit attribute in the json) to false and recolved the same problem..Steato
On Docker for Windows this option can be found in Settings -> Docker Engine -> buildkit = falseTitre
If you have Docker Desktop installed on your machine, you can also set the buildkit option to false in Docker Engine's configuration, as mentioned in this comment.Splashy
This works for me I have run this command into the shell, For permanent solution you may need to add in .bashrc file.Pascual
If you're on Windows and hate the Docker GUI try this $Env:DOCKER_BUILDKIT=0 $Env:COMPOSE_DOCKER_CLI_BUILD=0 Minded
I solved it only by setting export DOCKER_BUILDKIT=0Fixity
But what if you need DOCKER_BUILDKIT=1?Round
L
274

I had the same issue and all I had to do was to capitalize the Docker configuration filename:

dockerfile > didn't work

Dockerfile > did work

Luehrmann answered 21/10, 2020 at 17:34 Comment(5)
If you do not specify a docker file with the -f option, it searches for the default file "Dockerfile" in the current path. With "docker build -f dockerfile" you can choose which file is the docker fileDegradable
This pointed me in the right direction. Windows had added ".txt" to my Dockerfile. Removed that and problem solved.Mccune
It is a good practice to always use -f ./Dockerfile in the build commandRainwater
I created a Dockerfile using text edit and it by default gives an extension : .rtf. But the mac was not showing the extension. So please make sure the Dockerfile has no hidden extensions...Gash
if use docker-compose set dockerfile: to Dockerfile in docker-compose.yaml fileLepley
T
140

If you use Docker for Windows you need to disable buildkit from Docker Engine in Settings. It works for me and solved my error

Set buildkit option to false.

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "features": {
    "buildkit": false
  }
}

Docker for Windows buildkit option

Titre answered 29/11, 2021 at 10:26 Comment(5)
This also works on MacOS.Kumiss
According to this document, docker buildkit is a tool that can be used for speeding up the process of building a docker image.Kumiss
Doesn't seem to work for me on macOS.Decrement
@Decrement The answer literally says it's for Windows.Coniine
@Coniine the answer says; If you use Docker for Windows..., meaning the author is referring to the Docker App to change the setting they are referring to. Definitely doesn't read as, "this only works for Windows."Decrement
E
128

If you are seeing this issue it is not actually the real issue. The actual issue is nested in the error logs somewhere. To see the actual issue you need to run your build command like this:

DOCKER_BUILDKIT=0  docker build .

Notice the DOCKER_BUILDKIT=0. That will make the build kit not hide the nested error. From there you should be able to google the correct solution.

This will also make the build look different in command line, but don't worry about that. Just look for the error.

Exhibitive answered 7/4, 2021 at 20:27 Comment(2)
This was really helpful but I would like to know, now that I've found the problem, how to revert to the previous state ... is it DOCKER_BUILDKIT=1 ?Densmore
@Densmore there is nothing to revert. The command above does not really do anything other than run a build. If you run a build like normal it will overwrite the previous build.Exhibitive
P
75

Probably not the problem the OP had, but I had this issue while trying to build my container running inside Windows Subsystem for Linux (WSL) (Debian WSL2), just after having freshly installed Docker Compose and all I had to do was close the (Debian) terminal and reopen it and my issue was solved.

Plesiosaur answered 8/10, 2020 at 2:6 Comment(6)
which terminal and what window?Entertainer
Yes, more elaboration on this would be helpful, I'm using wsl and this works in a vm, but not in wsl.Chatman
In a windows host, WSL(Windows Subsystem for Linux) provides a way to run linux based commands. This is done by executing commands from a shell (Linux like) in windows. I had the same issue. Closing the shell and opening it again solved it.Arin
In my case, (on my Windows 10 PC) I didn't have WSL running, but I had multiple CMD windows open and also the Microsoft terminal BUT, I was running docker build from VSCode terminal. After I closed the Microsoft Terminal and the CMD windows, it began to work.Barna
I'm using WSL2 (Ubuntu) with Windows 10 and using the VSCode terminal (zsh). I configured the launch.json & task.json so i can run my application with a single click form VSCode but got that error message. I only had to re-start my VSCode and suddenly worked.Manufacturer
Thanks, how stupid it is... I even tried to re-install Docker Desktop but finally just closing my shell and open another one was fixing it. Note that I use WSL 2 with Ubuntu 20.04 but I think this is mainly an issue with WSL 2 and not related to the Distro.Zoril
V
46

If you are using Docker Desktop, restarting Docker worked for me. TroubleshootRestart

Vaulting answered 9/11, 2020 at 8:18 Comment(5)
Troubleshoot -> Restart is not a valid docker command. Please try and answer with valid commands that can be run in the terminal.Puklich
Monarindu meant to do this is in UI level of Docker Desktop. You can right click in the Docker logo (found in the icons of system tray), and select Restart Docker option or select Troubleshoot and click Restart in popped up UI window. If you need command line workarounds, please check this [forums.docker.com/t/restart-docker-service-from-command-line/…Doronicum
Restarting Docker didn't help. I also had to restart WSL. From powershell running wsl --shutdownIllusage
I did not find Troubleshoot → Restart, but your Restart idea did work. ✌Darkroom
I had to restart my machine but it did work. I did not set the [buildkit= false] option that other answers here are recommending.Biotechnology
F
35

I have the same issue.

Docker filename:

  • DockerFile - error
  • dockerFile - error
  • Dockerfile - work!

You need only one capitalized character.

Fabricant answered 31/8, 2021 at 13:52 Comment(0)
S
21

If you are using Docker Desktop for Mac or Windows, you might have to also disable it in your 'Docker Engine' JSON configuration.

Docker Desktop → SettingsDocker Engine → change the "features": { buildkit: true} to "features": { buildkit: false}.

Seidel answered 31/12, 2021 at 10:36 Comment(0)
P
20

I don't remember where exactly I read this, but if you are using WSL2 and receive that error, then delete the Docker configuration file in your WSL2 home folder and try to rebuild your image.

That is if you have already checked your file names and reconfirmed that everything is named correctly (Dockerfile, .dockerignore, etc.)

WSL2 Ubuntu:

rm ~/.docker/config.json
Pulmotor answered 18/3, 2021 at 15:11 Comment(1)
This is what worked for me. Also, the contents of my ~/.docker/config.json file was only { "credsStore": "desktop.exe" }. I'm guessing that this is the culprit. So maybe check your config file and make sure you aren't deleting other setttings that you might need.Claudioclaudius
E
15

In my case I was trying to copy over folder wp-content from my current directory, inside the Docker image I was building. Like so:

FROM wordpress:latest

# Copy wp-content
COPY ./wp-content/ ./var/www/html/wp-content/

However, I noticed that I had a .dockerignore file, which explicitly was told to ignore wp-content.

When I removed wp-content/ from .dockerignore it worked fine.

Enthetic answered 17/11, 2020 at 8:46 Comment(0)
W
12

In my case, I had an extra space after "." in the context option:

docker build -t myapp .[EXTRA_SPACE_HERE]
Weakminded answered 26/11, 2020 at 13:33 Comment(3)
Why would that matter? The shell wouldn't even pass the extra space to the docker binary unless you quote it (". ").Barony
Are you sure it was a normal space? Not some Unicode thingy? NO-BREAK SPACE, hair space, EM SPACE, or similar?Proximate
@PeterMortensen it was a normal space as I was executing this command on terminal directly. I don't remember correctly if I typed all that in or did I copy it from somewhere.Weakminded
D
10

Make sure your .dockerignore doesn't match your file.

A pattern sometimes used with .dockerignore is to add a wildcard to it and exclude the specifically expected file to the context with !filename syntax. EG:

*
!Cargo.toml
!Cargo.lock
!src
!setup.py
!README.md
!project
!requirements
__pycache__

If you later try to use a file in Dockerfile it will match the wildcard and not be present in the context. Add an exception to the new file or remove the wildcard to fix this.

Deutsch answered 24/12, 2020 at 17:56 Comment(0)
F
10

Disable the macOS v11 (Big Sur) virtualization framework:

Enter image description here

Fleshpots answered 18/5, 2021 at 18:38 Comment(1)
UPDATE: latest docker update fixes this issue for meFleshpots
O
8

In my case

failed to solve with frontend dockerfile.v0: failed to create LLB definition: no build stage in current context

was caused by setting ENV before FROM. Probably this is not allowed for some Dockerfile instructions. After moving ENV right after FROM the error is gone.

Otherdirected answered 24/2, 2021 at 9:2 Comment(0)
L
6

My problem was due to using VPN.

Launcher answered 18/6, 2022 at 15:20 Comment(0)
D
5

I had a typo,

FROM apline:3.7 instead of FROM alpine:3.7.

Dostie answered 24/3, 2021 at 6:5 Comment(2)
Yes, if the source doesn't exist, you'll get this too. Check spelling and check your base exists where you are pulling from.Hyalo
Setting builkit: false made my error message change and specifically point out this errorThere
S
5

I faced the issue due to VPN connectivity.

All I had to do was set a manual proxy in the Docker Desktop PROXIES section:

Enter image description here

Sabadell answered 26/6, 2021 at 8:32 Comment(1)
In my case, I had to use "Manual DNS configuration".Thrasonical
D
5

In my case, this was because of the under-expressed use cases from documents. Almost all examples tell you to use . and Dockerfile (capital D), but they mostly do not tell explicitly how to customize.

docker image build --tag any_image_tag --file any_file_name path_to_your_context_folder

This one is better in my opinion, and I hope it will help those coming here. any_file_name is really any file name with build instructions in it. "dockerfile" in it is not needed, but it helps to identify and give the full path if it differs from the context folder. path_to_your_context_folder is basically where your work resides, such as a web application.

For example, the following is my current test in windows where COPY . /app uses the context folder as the .:

docker image build --tag nested_image --file C:\WorkSpace\myapp\dockerfiles\any_file_name C:\WorkSpace\myapp\contextfiles\

PS: The topic really has interesting answers to the same problem, but by lots of exotic causes. Mine is just a side note to a hidden-in-plain-sight problem.

Denture answered 15/3, 2022 at 12:41 Comment(0)
G
5

Try with this simple solution, name your dockerfile like this Dockerfile with no extension.

Gravy answered 13/5, 2022 at 15:11 Comment(0)
E
5

It was solved for me

I was using a MacBook Air (M1) and had an issue, because I was using an image which supported linux/amd64 and my system architecture was arm64.

So make sure to run the compatible image based on your device.

Experience answered 26/5, 2022 at 11:45 Comment(1)
Yup this was it for me I had to add FROM --platform=linux/amd64 followed by the image nameNonetheless
C
4

I had to set "credsStore": "" in my ~/.docker/config.json .... It was previously set to credentials.exe.

In WSL2 ddev start fails at docker-credential-desktop.exe, "error listing credentials" #2342

Chenopod answered 22/4, 2021 at 11:55 Comment(1)
On Windows, presumably?Proximate
D
3

I got this issue when I'd run out of disk space, presumably exacerbated by the numerous image layer caches building up as I teased and tweaked my Dockerfile.

Dunning answered 24/3, 2021 at 21:18 Comment(0)
I
3

In case your Docker file is in a different path with a different name than Dockerfile you can run

docker build -t build_tag_name -f './path/to/dockerfile/exampledockerfile' .
Ideograph answered 11/1, 2022 at 20:0 Comment(0)
G
3

For me, I found that I was trying to build from the wrong directory.

Glynas answered 21/2, 2022 at 9:32 Comment(0)
C
3

In my case, I had 2 images, and I was copying from the same image. My specific error was: failed to solve: failed to solve with frontend dockerfile.v0: failed to create LLB definition: circular dependency detected on stage: kubexit

FROM karlkfi/kubexit:latest AS kubexit
COPY --from=kubexit /bin/kubexit /bin/

FROM maven:3.8-jdk-11-slim AS build

So it was a circular reference. The fix:

FROM karlkfi/kubexit:latest AS kubexit

FROM maven:3.8-jdk-11-slim AS build
COPY --from=kubexit /bin/kubexit /bin/
Congregation answered 5/4, 2022 at 20:39 Comment(0)
H
2

In my case, I had two problems:

  1. I missed the . in the end of the command that gives the context option, and
  2. I have a ".txt" extension in the file name of the Dockerfile.

After these two adjustments, all worked as expected.

Hautevienne answered 5/12, 2020 at 20:35 Comment(0)
W
2

Sometimes this kind of error comes from a stupid syntax error... In my case I modified a Dockerfile and removed some environment variables, but forgot to take off the backslash from the last line...

    WORDPRESS_HTTPS_PORT="8443" \
    WORDPRESS_HTTP_PORT="8080" \
    WORDPRESS_SKIP_INSTALL="yes" \ <-- to be removed

EXPOSE 8080 8443
USER 0
Waitress answered 27/2, 2021 at 10:43 Comment(0)
P
2

Make sure that you are using the same platforms, e.g. if you build the first image (my-custom-service) with

FROM --platform=linux/amd64 node:14

then you need to add the --platform to other Dockerfiles that use the baseimage of the first:

FROM --platform=linux/amd64 my-custom-service
Pakistan answered 4/6, 2021 at 8:53 Comment(0)
G
2

For me the following was the error:

failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head https://registry-1.docker.io/v2/library/postgres/manifests/13-alpine: net/http: TLS handshake timeout

I am using WSL2 in Windows 10 and Docker Desktop and I got this issue after updating the Docker Desktop to version 3.5.

I fixed the issue by enabling the WSL integration with additional distributions.

To enable it:

Open Docker Desktop in Windows and go to settingsResourcesWSL IntegrationEnable integration with additional distributions and enable it for the Ubuntu application that you installed.

Guanabara answered 7/7, 2021 at 14:50 Comment(0)
I
2

I had the same error, but by moving the Dockerfile out of the sub-folder and into the root folder of my application. It fixed the error message.

Illuminometer answered 12/8, 2021 at 9:22 Comment(0)
I
2

If you use Docker for Windows, then be sure that the Docker engine is set to the mode matching the image you want to build (Windows / Linux).

Invisible answered 6/9, 2021 at 7:33 Comment(0)
B
2

I had the same issue while building a Docker image through Visual Studio 2019. My Docker file had a name like Dockerfile.

Dockerfile > didn't work

dockerfile > did work

Bemuse answered 15/10, 2021 at 7:28 Comment(2)
hahhahaha dockerfile.txt didn't work as well ))Ferocious
Are you sure about that? Isn't it the other way around?Proximate
A
2

If you are using any new features that are not supported in v0 Dockerfile (like multiple build contexts), you need to specify Dockerfile version at the start of Dockerfile

For example in Dockerfile, first line would be:

#syntax=docker/dockerfile:1.4

Ascogonium answered 17/11, 2022 at 7:31 Comment(0)
A
1

Chiming in with another possibility that happened to me: If you're using build stages, make sure that you have the right stage names throughout.

I had a stage defined with

FROM zzz AS development

that was later used for another stage

FROM development AS yyy

On a whim I changed development to dev, but only in the first instance. So the latter one was still FROM development while the former was AS dev.

Odd how arcane the error message is for a such a minor mistake... You'd think they could just have the error message say "couldn't find development" or something.

Arlyn answered 10/4, 2021 at 21:39 Comment(0)
E
1

I ran into this problem using WSL2 Ubuntu, and I fixed it by changing the permissions of the Dockerfile.

When I set up WSL2 on my computer I copied some of my files (including the Dockerfile) directly from Windows into the Ubuntu root folder, which apparently results in files with blank permissions:

---------- 1 user user 10M Jan 1 00:00 Dockerfile

To fix it I ran chmod 644 Dockerfile:

-rw-r--r-- 1 user user 10M Jan 1 00:00 Dockerfile

And after that Docker was able to build the image without any further issue.

Expostulate answered 4/6, 2021 at 10:7 Comment(0)
K
1

In case you have a similar project structure,

├── docker
│   │
│   ├── app
│   │   └── Dockerfile
│   └── mlflow
│       └── Dockerfile
│
└── docker-compose.yml

you might be missing to specify the build: context in the docker-compose.yml:

version: '3'

services:

  mlflow:
    build:
      context: ./
      dockerfile: ./docker/mlflow/Dockerfile
    container_name: ml_app_mlflow
    volumes:
      - ./db:/db
    ports:
      - 5000:5000
Kalidasa answered 9/11, 2021 at 18:19 Comment(1)
didnt work for meJennette
G
1

In my case I was not in the same directory as the dockerfile itself.

Gurglet answered 10/5, 2022 at 8:55 Comment(1)
Capital D 'Dockerfile'?Proximate
S
1

I solved this problem by just adding sudo (Ubuntu) at the head of the build command. For example:

sudo docker build --tag somename .
Scar answered 18/8, 2022 at 18:30 Comment(0)
P
1

All it took for me was adding --no-cache as an argument to the build.

Perceptible answered 31/8, 2022 at 21:25 Comment(0)
E
1

For Me

I Opened Docker Desktop->open settings->Docker Engine->

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "features": {
    "buildkit": false
  }
}

Here My default value of buildkit is true -> i changed to false and restart the docker engine

that worked for me

Eckel answered 28/10, 2022 at 23:9 Comment(0)
C
1

With the docker desktop this issue is usually solved by adding -f option. for example : Let your docker file is placed at c:\Dockerfile.txt

you can run the following command to build the image

docker build -f "c:\Dockerfile.txt"

Cannot answered 27/11, 2022 at 12:17 Comment(0)
S
1

None of the other answers worked for me. In my case the problem was I had some permission issues with docker in CLI and rather than fixing it I was just using sudo. So I fixed those permission issues (in the ~/.docker/buildx folder) and ran docker without sudo and it worked.

Selassie answered 6/12, 2022 at 4:59 Comment(0)
S
1

The issue was fixed for me after removing the "LABEL" Instruction & its Argument in my Dockerfile

LABEL maintainer="[email protected]"

Solus answered 11/2, 2023 at 12:51 Comment(0)
U
0

If you are using Windows Subsystem for Linux (WSL), check if Docker is running before you launch the window. If you have started Docker after starting the window. Then Just restart your terminal. And it should work if your file is correct.

Unmade answered 6/2, 2021 at 9:0 Comment(0)
E
0

Specify the proxy server by setting the HTTP_PROYY and HTTP_PROXYS environment variables.

Example:

http_proxy=http://username:[email protected]:8080
https_proxy=http://username:[email protected]:8080
Estimable answered 26/4, 2021 at 2:8 Comment(0)
G
0

As far as I can see, this error can have many reasons.

In my case, there were two errors: (1) in the Dockerfile: the # syntax = ***** line was incorrectly spelled out and (2) in file docker_compose.yaml, the web / build: * line was pointing to the wrong directory.

I was helped by reading the Dockerfile documentation and taking a break to regain attention.

Grommet answered 2/7, 2021 at 3:30 Comment(0)
L
0

In my case, I had to uninstall Astrill VPN.

Leukoderma answered 21/7, 2021 at 15:19 Comment(1)
You are right, it's an issue with the VPN for me as well. We don't need to uninstall the VPN, just disconnect. Or else, you can do the proxy setup as well. Check this answer : https://mcmap.net/q/86872/-an-error-quot-failed-to-solve-with-frontend-dockerfile-v0-quotSubteen
S
0

I've had this issue/error before when I had a script that I used to build multiple Dockerfiles and where one of the Dockerfiles was commented out. Once I uncommented the Dockerfile and run the script again it worked fine for me.

Spang answered 28/7, 2021 at 12:47 Comment(0)
G
0

In case you previously executed docker buildx install, your docker command is aliased to docker buildx, which is based on Docker Buildkit, which is currently not supported (sadly) for Windows containers.

To remove the alias, execute the following command:

docker buildx uninstall

I hope that will save time to people like me, who forgot about this alias

Grayish answered 6/2, 2022 at 16:21 Comment(0)
A
0

Yet another possibility: I was using Linux-based containers on Windows 10 for WSL when trying to build a Dockerfile with a Windows 10 servercore image.

In the system tray, right-click Docker Desktop and select Switch to Windows containers...

Audio answered 7/7, 2022 at 16:17 Comment(0)
W
0

I had the same issue while using visual studio 2022. The problem was that visual studio 2022 make a logical directory structure which was different from the physical directory structure. So the file was physically not present at the location where visual studio 2022 was showing.

Once the correct location was specified, it works fine.

I did not have to change DOCKER_BUILDKIT=0 or any settings. But used -f option to specify the docker file.

Windcheater answered 27/11, 2022 at 22:43 Comment(0)
P
0

Try removing your comments and run again, It worked for me

Pixie answered 25/2, 2023 at 11:6 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Poyang
A
0

I got a similar output. Turns out I exported USER='' in my .zshrc. Exporting a value there fixed the issue: USER='yourname'

[...]
Failed to fire hook: while creating logrus local file hook: user: Current requires cgo or $USER set in environment
[2023-02-27T11:20:07.698673000Z][docker-credential-desktop][F] user: Current requires cgo or $USER set in environment
[common/pkg/paths.Home()
[   common/pkg/paths/paths.go:105 +0x54
[common/pkg/paths.Container()
[   common/pkg/paths/user_darwin.go:30 +0x1d
[common/pkg/paths.Data()
[   common/pkg/paths/paths_darwin.go:27 +0x19
[+] Building 1.0s (3/3) FINISHED
 => [internal] load build definition from Dockerfile                                                                                       0.1s
 => => transferring dockerfile: 37B                                                                                                        0.0s
 => [internal] load .dockerignore                                                                                                          0.0s
 => => transferring context: 2B                                                                                                            0.0s
 => ERROR [internal] load metadata for docker.io/library/node:16-buster                                                                    0.8s
------
 > [internal] load metadata for docker.io/library/node:16-buster:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ``
Actuary answered 27/2, 2023 at 11:24 Comment(0)
V
0

I had a symlink to the directory I was running docker build from. Make sure you cd into the actual path of the directory your Dockerfile is in, and not run it from a symlink path.

Voluntaryism answered 23/3, 2023 at 13:8 Comment(0)
N
0

Is my case it was because the applications defined in a docker-compose file did not have individual Dockerfiles, but was sharing the same Dockerfile. After defining in docker-compose.yml:

build:
  dockerfile: <RELATIVE_PATH_TO_THE_DOCKER_FILE>

In each of the apps build section, it is building correctly.

Northbound answered 10/5, 2023 at 12:53 Comment(0)
L
-1

In my case it worked after I've restarted the VPN connection.

Louvar answered 20/2, 2023 at 8:26 Comment(0)
T
-1

This is simple actually, if you will read full error solution is there only:

error says: failed to solve with frontend dockerfile.v0: failed to read dockerfile, it means it is looking for docker file which is named as dockerfile, so chances maybe you renamed or have created your Docker file with some different name.

Taunyataupe answered 16/4, 2023 at 8:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.