Jenkins Pipeline for Docker Image Build and Push
Objective
Automate the process of building a Docker image for an Express API and pushing it to Docker Hub whenever there is a code commit.
Benefits
- Consistency: Ensures the Docker image is always up-to-date with the latest code changes.
- Efficiency: Reduces manual work by automating the build and push process.
- Reliability: Automated pipelines are less prone to human errors.
Overview of Steps
- Setup Project
- Create Dockerfile
- Upload Project to GitHub
- Create Credentials for Docker Hub and GitHub
- Create a Jenkins Pipeline and Trigger on Push Event