Docker Build即使我的文件已更改
我有一个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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论