Is this a docs issue?
Type of issue
I can't find what I'm looking for
Description
The documentation used to state that we should use:
# Download dependencies as a separate step to take advantage of Docker's caching.
# Leverage a cache mount to /root/.npm to speed up subsequent builds.
# Leverage a bind mounts to package.json and package-lock.json to avoid having to copy them into
# into this layer.
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci --omit=dev
And it was also justified in the comment.
But then, in this commit b11f7a5 it went back to normal COPY from RUN --mount:
# Copy package files
COPY package*.json ./
# Install production dependencies
RUN --mount=type=cache,target=/root/.npm,sharing=locked \
npm ci --omit=dev && \
npm cache clean --force
And there is no explanation provided anywhere.
Location
https://docs.docker.com/guides/nodejs/containerize/
Suggestion
Explain the change or revert it, if it's not the best practice
Is this a docs issue?
Type of issue
I can't find what I'm looking for
Description
The documentation used to state that we should use:
And it was also justified in the comment.
But then, in this commit b11f7a5 it went back to normal
COPYfromRUN --mount:And there is no explanation provided anywhere.
Location
https://docs.docker.com/guides/nodejs/containerize/
Suggestion
Explain the change or revert it, if it's not the best practice