Technical questionAccepted answer
An error, "failed to solve with frontend dockerfile.v0"
Muhammad Yasir
Oct 6
0 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
PermalinkOct 21
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.
Storm MullerPermalink
Oct 28
This question needs more detail. does the .env file actually exist or not?
user28186Permalink
Jul 28
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.