Installation Environment
Operating system centos7.3
Installing Docker, installation and configuration see Docker Docker Introduction and installation Configuration jenkins Download Jenkins
Command: sudo docker pull Jenkins is ready to create Jenkins folder before starting Jenkins
Create a Jenkins folder for disk-mounted and in-container folders
Command: Mkdir/home/hzq/jenkins
Note: When you install Jenkins, the attribution user ID that hangs in the folder/home/hzq/jenkins/must be 1000, otherwise the no-action permission exception will be thrown. Exceptions are as follows:
why the attribution user ID for a folder must be 1000.
For the first time I contacted Jenkins, it was really depressing. Why the UID must be 1000. With a question I went to see the dockerfile provided in the Docker Central warehouse, where I saw the following code:
View folder's Attribution
Command: Ls-nd folder name
to modify the ownership and group of folders
Command: sudo chown-r 1000:1000 jenkins/ start Jenkins start Jenkins
Command:
sudo docker run-itd-p 8080:8080-p 50000:50000--name Jenkins--privileged=true -v/home/hzq/jenkins:/var/jenkins_h Ome Jenkins
-P 8080:8080-p 50,000:50,000 for port mapping
--privileged=true in CentOS7 the security module SELinux has restricted the permissions, the parameters to the container plus privileges.
-v/home/hzq/jenkins:/var/jenkins_home Disk Mount view run status
Command: sudo Dockers PS
first use of Jenkins 1. Get the Administrator password:
Enter Jenkins in the browser input "localhost:8080", the first entry needs to get the administrator's password, as shown in figure:
Get Password method one:
When Jenkins starts, we set the folder to hang, so we can view the password directly in the local Jenkins directory:
Get Password Method two:
Get password when not hanging on disk
Command: sudo docker exec Jenkins Cat/var/jenkins_home/secrets/initialadminpassword
There is actually another way to get inside the container using the Attach command, and then look at the password. This way of operation is too cumbersome, not explained here.
Through the above method, get to the password and enter Jenkins. 2, configure the network agent (do not need to go online through the agent Skip)
Because the personal network needs to configure the agent to surf the internet, so this belongs to the offline status, click on the "Confirure proxy" setting agent.
3, install the plug-in
You can customize the installation plug-in, or you can install the recommended plugins.
To start the installation:
4. Create User
5. Complete
I am Heng Zhao Qing, a member of the North Drift.
Life motto: [Make a decision, not difficult, difficult is to put into action, and adhere to the end]