Can I use multiple containers on a jenkins declarative pipeline?

0 votes
Can I use multiple containers on a single Jenkins declarative pipeline?
Apr 12 in Jenkins by Gyan
605 views

1 answer to this question.

0 votes

Yes of course you can!! You try something like this:

Jenkinsfile (Declarative Pipeline)

pipeline {
    agent none
    stages {
        stage('Back-end') {
            agent {
                docker { image 'maven:3-alpine' }
            }
            steps {
                sh 'mvn --version'
            }
        }
        stage('Front-end') {
            agent {
                docker { image 'node:7-alpine' }
            }
            steps {
                sh 'node --version'
            }
        }
    }
}
answered Apr 12 by Vedant

Related Questions In Jenkins

0 votes
1 answer

Use a docker image with jenkins declarative pipeline

Hey @Jithin, you could use something like ...READ MORE

answered Apr 12 in Jenkins by Bishu
806 views
0 votes
1 answer

running a Jenkins job on multiple virtual servers.

Your goals can be achieved by using ...READ MORE

answered May 25, 2018 in Jenkins by shubham
• 6,890 points
168 views
0 votes
1 answer

I’m facing a login error when I try to run Jenkins on Docker. How do I solve this?

You have to open the /var/log/jenkins/jenkins.log file to ...READ MORE

answered Jul 24, 2018 in Jenkins by Sophie may
• 9,850 points
279 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,900 points
189 views
0 votes
1 answer

Jenkins and Docker: How can I customize my jenkins pipeline to use docker?

Jenkins Pipeline is designed to easily use ...READ MORE

answered Aug 26 in Jenkins by Sirajul
• 30,540 points
310 views