Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cbi-dev] Docker on Jenkins Dash

Hi Mikael,


IIRC, the args "-u" you're giving to the Dockerfile pipeline is used to define which user is used inside the container, not how to to run docker. It does not relate to which user starts the docker command.

With the current setup, Dash Jenkins user (named genie.dash), can only run "sudo docker" (see https://www.projectatomic.io/blog/2015/08/why-we-dont-let-non-root-users-run-docker-in-centos-fedora-or-rhel/ for reasoning).

Unfortunately, Jenkins docker pipeline does not support this setup.

Thanks for confirming.


AFAIK, Glassfish uses Docker successfully in Dash JIPP, not through pipeline though.


Yes, I’m aware how GlassFish jobs are running. But I’m keen on using pipeline approach.


So I would go with a non-docker agent and start the build step with a shell command calling the docker run command itself. Something like:

pipeline {
    agent { label 'glass-slave1'  } 
    stages {
        stage('Example Build') {
            steps {
                sh  'sudo docker run -it --rm -v ${WORKSPACE}:/build maven:3.5.3-jdk-8-slim mvn clean verify -f /build/pom.xml'
            }
        }
    }
}


Thanks, I will go with non-docker agent now that I know docker/dockerfile option of agent is not supported.

-Yamini



Back to the top