It is always better to implement/practice new things from scratch, if we do like that then definitely we get a complete understanding of that topic. But the problem is, we can not perform these steps over and over again “uninstall — install — set up the Jenkins admin account — install suggested plugins”.
So I have created a simple Dockerfile for myself with the required configurations and then created a docker image out of it. That’s it, Whenever I need a brand new local Jenkins setup, I will just launch a container with that image.
Enough with the theory, let's get started with the demo. whenever/wherever I need a new Jenkins setup for testing, I will just execute below 1 line and the rest is magic.
After 2 mins (Depends on your internet speed for the first time), you can access the Jenkins at http://your_ip:8080. username and passwords are admin and admin.
If you want to customize more like default plugins ,username and password then you fork my git repo and play around