yarn cache clean
after yarn install
DOK-P1005yarn cache clean
missing after yarn install
was run. 4
5WORKDIR /app
6
7RUN yarn install 8RUN yarn run build
9
10CMD ["yarn","run","production"]
yarn cache clean
missing after yarn install
was run. 6
7COPY . .
8
9RUN yarn install10
11CMD ["yarn","run start"]
12
yarn cache clean
missing after yarn install
was run. 4
5COPY . .
6
7RUN yarn install 8
9EXPOSE 7000
10
yarn
keeps a local cache of downloaded packages. Not cleaning cached package data after installation can result in higher image sizes.
It is always recommended to clean the cached packages after installing them.
Please note that the clean-up must be performed in the same RUN
step as it creates a separate layer. Doing this in a different RUN
command would therefore result in a new layer, which will not help reduce the image size.
RUN yarn install
RUN yarn install && \
yarn cache clean