如何验证纱线真的正在使用缓存文件夹?
我正在使用Docker为一个NextJS项目安装依赖项。 每当我运行此自定义CI时,我可能会永远使用纱线安装
3分钟前。该机器具有持久的存储空间,我正在当地机器构建包装。
如何验证缓存是否使用?
我的命令是:
docker container run --rm --entrypoint='' -u root \
--platform linux/amd64 \
-v .:/usr/src/app \
-v ~/yarn-cache:/yarn-cache \
-w /usr/src/app \
node:16.4.0 /bin/bash -c 'YARN_CACHE_FOLDER=/yarn-cache yarn install'
请注意,我将卷〜 /YARN-CACHE附加到Docker Container /Yarn-Cache 然后,在运行YARN安装之前,请与Env varialbe在YARN中记录的CACHE文件夹,
YARN_CACHE_FOLDER=/yarn-cache
该文件夹〜/YARN-CACHE已经存在于主机计算机中,并且从未使用或填充数据...
因此,根据我的理解YARN < /code>
在docker容器中运行
不使用我使用yarn_cache_folder =/yarn-cache
在命令本身yarn install install
I am using docker to install dependencies for one nextjs project.
Every time I run this custom CI it takes forever, although I might have installed the yarn install
3 minutes ago. The machine has persistent storage, I am building the packages from my local machine.
How can I verify that the cache is used or not?
My command is:
docker container run --rm --entrypoint='' -u root \
--platform linux/amd64 \
-v .:/usr/src/app \
-v ~/yarn-cache:/yarn-cache \
-w /usr/src/app \
node:16.4.0 /bin/bash -c 'YARN_CACHE_FOLDER=/yarn-cache yarn install'
Please take note I am attaching the volume ~/yarn-cache to docker container /yarn-cache
then before running yarn install am specifying the cache folder as documented in yarn with the env varialbe
YARN_CACHE_FOLDER=/yarn-cache
The folder ~/yarn-cache exists already in host machine and is never used or filled with data...
So from my understanding yarn
that runs inside docker container
is not using the cache folder that I specify with YARN_CACHE_FOLDER=/yarn-cache
before the command itself yarn install
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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