How to Install Jenkins on CentOS 7 Using Docker
This guide walks through installing Docker on CentOS 7, pulling the official Jenkins image, creating a host volume, running the container with proper port and volume mappings, retrieving the initial admin password, and completing the Jenkins setup with recommended plugins.
Install Jenkins via Docker on CentOS 7
Search the Jenkins image:
docker search jenkinsPull the image and verify it was downloaded:
docker pull jenkins/jenkins
docker imagesCreate a host directory for Jenkins data and grant full permissions:
mkdir /jenkinshome
chmod 777 -R /jenkinshome/Run the Jenkins container in detached mode, mapping host port 8088 to container port 8080 and mounting the data volume:
docker run -d --name jenkins -p 8088:8080 -v /jenkinshome:/var/jenkins_home jenkins/jenkins:latest -d: run in background --name: container name -p: host:container port mapping -v: host directory to container directory volume mount
Access Jenkins from a browser at http://HOST_IP:8088. Ensure the host firewall allows port 8088. The UI prompts for the initial admin password.
Retrieve the password by entering the container and reading the secret file:
docker exec -it jenkins /bin/bash
cat /var/jenkins_home/secrets/initialAdminPasswordCopy the displayed password and paste it into the Jenkins setup page.
After unlocking, install the recommended plugins, then create an administrator user and password.
Complete the configuration; Jenkins is ready for creating jobs and pipelines.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
The Dominant Programmer
Resources and tutorials for programmers' advanced learning journey. Advanced tracks in Java, Python, and C#. Blog: https://blog.csdn.net/badao_liumang_qizhi
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
