While building the docker images, after the below steps
- Installing dependencies (RUN yarn install)
- generate build (RUN ng build --prod)
If I clean the yarn cache from usr location using below command in docker file, will it affect afterward when I run the docker image?
RUN rm -rf /usr/local/share/.cache/yarn/*
as the docker images size was huge 1.2 GB so I have clean the above location that has close to 450+ MB.
I am using a lower version of docker (for a specific reason) which doesn't support multistage build.
Also, is the above command is equivalent to RUN yarn clean cache?
FROM node:10-alpine
WORKDIR /app
COPY . /app
RUN apk --no-cache add yarn \
&& yarn install \
&& ng build --prod \
&& rm -rf /var/cache/apk/* \
&& rm -rf /usr/local/share/.cache/yarn/*
EXPOSE 3000
CMD ["npm", "run", "start"]