我正在尝试通过已将 yarn.lock 中的所有当前软件包安装在映像上来加速启动 docker。我认为我的纱线安装不正确,它在其他地方工作吗?
dockerfile 的相关部分:
# Create a dir
WORKDIR /(WORKDIR)
# Time to install all our dependencies
COPY package.json /(WORKDIR)/package.json
COPY yarn.lock /(WORKDIR)/yarn.lock
# Need the executables to be in the path
ENV PATH /(WORKDIR)/node_modules/.bin:$PATH
RUN yarn check --verify-tree || yarn install --frozen-lockfile
我认为我的最后一行是不正确的。它安装在某个地方,但不是安装在包本身上?无论是那个还是缓存都可能是一个问题。如果我启动图像,我发现输出yarn check --verify-tree
仍然是图像的当前状态。