由于jvm cacert,使用Docker代理的Jenkins管道无法推送伪影

fiei3ece  于 2022-11-02  发布在  Maven
关注(0)|答案(1)|浏览(183)

我需要将Jenkins管道中获得的一些jar文件推送到Jfrog;在代码下面:

stage ('Artifactory configuration') {
            when { expression { params.runDelivery } }
            steps {
                rtServer (
                    id: "artifactory",
                    url: "https://jfroglocal/artifactory",
                    credentialsId: "jfrog"
                )

                rtMavenDeployer (
                    id: "MAVEN_DEPLOYER",
                    serverId: "artifactory",
                    releaseRepo: "example-repo-local",
                    snapshotRepo: "example-repo-local"
                )
            }
        }

此处显示错误:

[m org.apache.maven.cli.MavenCli -  Skipping deployment of remaining artifacts (if any) and build info. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target etc

如果我直接从“jenkins从服务器”运行管道,则在将/usr/lib/jvm/java-11-openjdk-amd 64/lib/security/cacert链接到/etc/ssl/certs/java/cacerts之后,错误会消失
如果我从Docker代理运行相同的管道,错误仍然存在;低于申报代理商:

agent {
        docker {
            label 'Ubuntu-20.04-Slave'
            image 'node:10'
            args '-u root'
        }

    }

如何将cacert文件链接到容器中?

brqmpdu1

brqmpdu11#

尝试
args '-v /usr/lib/jvm/java-11-openjdk-amd64/lib/security/cacert: /etc/ssl/certs/java/cacerts'

相关问题