Skip to main content

Command Palette

Search for a command to run...

🔄Day 27 - Jenkins Declarative Pipeline with Docker

Published
1 min read
🔄Day 27 - Jenkins Declarative Pipeline with Docker
S
Hi, I’m Sarika 👋 I’m a QA Engineer with 2+ years of experience in software testing. I have hands-on experience in: * Functional & Regression Testing * API Testing using Postman * Database validation using SQL * Cross-browser testing Currently, I’m focusing on: * Automation Testing using Selenium & Playwright (Java) * Building real-world testing frameworks * End-to-End testing (UI + API + DB) This blog is where I share: * What I learn daily * Real testing scenarios * Practical examples (not just theory) * Interview-focused concepts 🚀 Learning | Building | Sharing Follow me on LinkedIn: https://www.linkedin.com/in/sarika-kamble-3153b3218/

💎Use your Docker Build and Run Knowledge

docker build - you can use sh 'docker build . -t <tag>' in your pipeline stage block to run the docker build command. (Make sure you have docker installed with correct permissions.

docker run: you can use sh 'docker run -d <image>' in your pipeline stage block to build the container.

How will the stages look

stages {
        stage('Build') {
            steps {
                sh 'docker build -t trainwithshubham/django-app:latest'
            }
        }
    }

💎Task-01

  • Create a docker-integrated Jenkins declarative pipeline

  • Use the above-given syntax using sh inside the stage block

  1. Create a new job, select pipeline project.

  1. Under Source Code Management, select Git and Added the repository URL.

  1. Within the Jenkins job's Pipeline build step, Write declarative pipeline script.

  1. Save and click on Build Now.

  1. You can check your logs in Console Output.

📚Happy Learning :)

More from this blog

S

Sarika Tech Journey

42 posts