How to automate Docker Images creation using Jenkins

Every time developer makes code changes, you would want to Jenkins to automate Docker images creation and pushing into Docker registry. Let us see how to do this.


Pre-requisites:
Jenkins is up and running
Docker is installed in Jenkins machine.

Docker plug-in installed in Jenkins.
Docker pipeline plug-in installed in Jenkins.

Steps:

Now Login to Jenkins EC2 instance, execute below commands:

Add jenkins user to Docker group
sudo usermod -a -G docker jenkins

Restart Jenkins service
sudo service jenkins restart

Reload system daemon files
sudo systemctl daemon-reload

Restart Docker service as well

sudo service docker stop
sudo service docker start

Comments

Popular posts from this blog

Install Ansible on Ubuntu | How to setup Ansible on Ubuntu 22.0.4 | Ansible install on Ubuntu

Installing SonarQube using Docker || Installing SonarQube using Docker on Ubuntu 22.0.4 || Installing SonarQube using Docker-Compose

Setup build agent/slave VM and Integrate with Jenkins Master