Docker Build即使我的文件已更改

发布于 2025-02-13 19:42:26 字数 458 浏览 1 评论 0原文

我有一个dockerfile,如下所示:

FROM node:14-alpine as frontend-builder
WORKDIR /app/frontend
COPY ./frontend .
ENV PATH ./node_modules/.bin/:$PATH
RUN set -ex; \
  yarn install --frozen-lockfile --production; \
  yarn cache clean; \
  yarn run build
CMD ["tail", "-f", "/dev/null"]

我在frontend文件夹中更改了一个文件,然后重新运行构建和docker正在使用cache ...我知道我可以使用构建的强制 - 无编码,但是如何调整Docker,以便检测文件中的更改而不是“无循环”选项?

I have a Dockerfile that is as follow:

FROM node:14-alpine as frontend-builder
WORKDIR /app/frontend
COPY ./frontend .
ENV PATH ./node_modules/.bin/:$PATH
RUN set -ex; \
  yarn install --frozen-lockfile --production; \
  yarn cache clean; \
  yarn run build
CMD ["tail", "-f", "/dev/null"]

I have changed one file in frontend folder and re-run the build and Docker is using the cache... I know I can force to build with --no-cache but how can I tweak Docker so it detects changes in my files instead of "no-cache" option?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文