Unable to pip install in Docker image as agent through Jenkins declarative pipeline

后端 未结 3 1916
有刺的猬
有刺的猬 2021-02-15 06:34

I have yet another issue with permissions running Docker through Jenkins declarative pipeline. I want to build and publish a Python package through a Jenkins job in a D

3条回答
  •  醉梦人生
    2021-02-15 07:05

    You can try executing it as sudo:

     stage('Package') {
          steps {
            sh '''
                python -V
                sudo python -m pip install -r requirements.txt --user --no-cache
                sudo python setup.py sdist
               '''
          }
        }
    

    You may have issues due Jenkins is not able to run command as sudo in that case I will recommend you to follow the steps mentioned in this article or in this SO question

提交回复
热议问题