failed to solve with frontend dockerfile.v()
The problem failed to solve with frontend dockerfile.v()
This problem failed to solve with frontend dockerfile.v() mainly arrives while one is trying to run the following command in their docker file. The command is shown below:
While running this command the error that appears on your screen is shown below:
failed to solve with frontend dockerfile.v0: failed to build LLB:
failed to compute cache key: "/.env" not found: not found
The docker file for the above error is shown below as an example:
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"]
Solution
One of the best solutions for the above problem is not to use the build kit while running the following code. To execute this solution run the following lines of code:
export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0
Another solution is to just change the casing while naming the docker file. The name of the file must start with upper case letters instead of lower case ones. The example for the same is shown below:
dockerfile: do not work
Dockerfile: work
One more theory regarding the same issue is that the problem you are experiencing is not the underlying problem. The actual problem is hidden somewhere in the error logs. Run your build command as follows to observe the true problem:
DOCKER_BUILDKIT=0 docker build .
Pay attention to DOCKER BUILDKIT=0. As a result, the construction kit will not conceal the nested error. You ought to be able to find the appropriate solution on Google from there. Don’t worry about the build’s appearance in the command line changing as a result.
The last solution is for the users who are specifically working on the windows operating system. They need to set the bulidkit as false.
{ "builder": { "gc": { "defaultKeepStorage": "20GB", "enabled": true } }, "experimental": false, "features": { "buildkit": false } }
Also Read: Built-in Functions of Python