相关疑难解决方法(0)

无法通过 Jenkins 声明性管道在 Docker 映像中作为代理安装 pip

还有另一个问题,即通过 Jenkins 声明性管道运行 Docker 的权限。我想通过 Docker 容器中的 Jenkins 作业构建和发布 Python 包:

pipeline {

  agent {
    docker {
      image 'python:3.7'
      label 'docker && linux'
    }
  }

  environment {
    PACKAGE_VERSION = readFile 'VERSION'
  }

  stages {

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

    stage('Deploy') {
      steps {
        ...
      }
    }

  }

  post {
    always {
      cleanWs()
    }
  }

}
Run Code Online (Sandbox Code Playgroud)

但是,pip install由于以下原因,我不允许PermissionError: …

python pip jenkins docker

11
推荐指数
1
解决办法
5834
查看次数

标签 统计

docker ×1

jenkins ×1

pip ×1

python ×1