🔄Day 27 - Jenkins Declarative Pipeline with Docker

💎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
shinside the stage block
- Create a new job, select pipeline project.

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

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

- Save and click on Build Now.

- You can check your logs in Console Output.


📚Happy Learning :)





