npm install fails in jenkins pipeline in docker

前端 未结 12 932
野性不改
野性不改 2020-12-07 17:45

I\'m following a tutorial about Jenkins pipeline and I can get a \"hello world\" working under at node 6.10 docker container.

But, when I added a default EmberJS app

12条回答
  •  臣服心动
    2020-12-07 18:22

    In my case the problem was that inside the container I was user jenkins instead of root. I got there by setting whoami inside the container and got error like cannot determine user 111 (which happens to be jenkins). So I did the following:

    stage('Run build') {
            webappImage.inside("-u root") {
                sh "yarn run build"
            }
        }
    

提交回复
热议问题