无法使用前端 DockerFIle.v0 解决 [英] Failed To Resolve With FrontEnd DockerFIle.v0
本文介绍了无法使用前端 DockerFIle.v0 解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图为我的 Gatsby 应用程序构建我的 Docker 映像.每当我运行命令 docker build .-t gatsbyapp
,它给了我一个错误:
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
与此同时,我的 Dockerfile 如下所示:
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"]
推荐答案
我在 mac 上升级到最新的 docker 桌面版本后遇到了这个问题.解决了关于这个问题
I had experienced this issue after upgrading to the latest docker desktop version on mac. Solved with the comment on this issue
解决方案:不要使用 buildkit,它对我有用.
Solution: Don't use buildkit and it works for me.
export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0
这篇关于无法使用前端 DockerFIle.v0 解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文