温馨提示:本文翻译自stackoverflow.com,查看原文请点击:node.js - Publish NPM package from inside docker container

node.js - 从Docker容器内部发布NPM软件包

发布于 2020-03-27 11:15:20

我拼命想将我的NPM软件包发布到我们的NPM回购中。我不断收到错误消息,指出我的工作目录不干净,无法理解。

这是我的Dockerfile:

FROM node:12

ARG VERSION

COPY .npmrc /root/.npmrc
COPY .gitconfig /root/.gitconfig
COPY .git-credentials /root/.git-credentials

WORKDIR /home/node/app/

COPY package.json package.json

RUN npm install

COPY . .

RUN npm run release:testless -- ${VERSION}

package.json:

  "scripts": {
    "prepare": "npm run prepare:util",
    "prepare:util": "npm explore vl-ui-util -- npm run install:copy",
    "test": "wct -l chrome,firefox --npm",
    "release": "npm run release:prepare && np",
    "release:prepare": "npm run release:prepare:build",
    "release:prepare:build": "npm run build",
    "release:prepare:commit": "git add -f vl-map.js && git commit --amend --no-edit && git pull",
    "release:testless": "npm run release:prepare && np --yolo",
    "demo": "npm run dev",
    "dev": "concurrently \"npm:bundle:watch\" \"http-server\"",
    "build": "npm run bundle:build",
    "bundle:watch": "rollup --config rollup.config.js --watch",
    "bundle:build": "rollup --config rollup.config.js"
  }

结果是:

npm ERR! Git working directory not clean.

查看更多

查看更多

提问者
Homewrecker
被浏览
131
Homewrecker 2019-07-03 22:32

我通过在容器内进行克隆而不是让Bamboo进行克隆并将所有源文件复制到容器中来解决。

发布
问题

分享
好友

手机
浏览

扫码手机浏览