我有一个 dockerfile,如下所示,但是在 RUN npm ci
步骤中,有一个警告,
Npm WARN old lockfile 这个 package-lock. json 文件是用旧版本的 npm 创建的
我想不通。
我尝试使用 npm install,而不是 npm ci,并添加了 --package-lock
标志,但我仍然得到这个警告。这是一种警告,我必须忽略它或者我应该做什么来解决这个问题?
Step 12/26 : RUN npm ci --production --package-lock && npm ci --production --package-lock --prefix ./ui-runner
---> Running in 3473c209b98c
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
这是我的 文件夹。
FROM node:14.17.1-alpine3.13 AS builder
WORKDIR /usr/src/app
COPY package.json package-lock.json* ./
COPY ui-runner/package*.json ./ui-runner/
COPY .npmrc .npmrc
COPY ui-runner/.npmrc ./ui-runner/.npmrc
RUN npm -g install npm@7.19.1
RUN npm ci --production --package-lock && \
npm ci --production --package-lock --prefix ./ui-runner
RUN rm -f .npmrc && \
rm -f ui-runner/.npmrc
FROM node:14.17.1-alpine3.13
WORKDIR /usr/src/app
RUN apk update && apk add --no-cache curl bash
RUN addgroup -g 1001 test && \
adduser -S -u 1001 -G test test
RUN chown -R test /usr/src/app && \
chmod 755 /usr/src/app
COPY --from=builder /usr/src/app /usr/src/app
COPY . .
RUN npm run build:docker
USER test
EXPOSE 3000 9183
CMD [ "npm", "run", "start:ui-runner" ]