QuestionAccepted answer
An error, "failed to solve with frontend dockerfile.v0"
Muhammad Yasir
20 Mar 2026, 16:00 UTC
12K views1
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"]
1 answer
Accepted answer · original discussion
Luis Gouveia
Permalink21 Mar 2026, 20:48 UTC
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
3 question comments
Use comments to ask for clarification. Post a solution as an answer.
LiamPermalink
23 Mar 2026, 01:36 UTC
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.
Storm MullerPermalink
24 Mar 2026, 06:24 UTC
This question needs more detail. does the .env file actually exist or not?
user28186Permalink
25 Mar 2026, 11:12 UTC
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.