Score:0

Jenkins pipeline using docker agent can't push on artifactory due to jvm cacert

cn flag

I need to push some jar files obtained during a Jenkins pipeline, to Jfrog; below the code:

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"
                )
            }
        }

here the error:

[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

if I run the pipeline directly from the "jenkins slave server" the error disappear after linkng /usr/lib/jvm/java-11-openjdk-amd64/lib/security/cacert to /etc/ssl/certs/java/cacerts

if I run the same pipeline from an docker agent the error persists; below the declared agent:

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

    }

how can i link the cacert file (of the jenkins slave) into the container?

there is a way to configure jenkins to share the JVM cacert with the container?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.