Docker version Jenkins built.
1. Download Docker
Yum Install Docker-y
1.1 Configuration Docker boot up by systemd
Systemctl Enable Docker
1.2 Start Docker
Systemctl Start Docker
2. Download Docker version Jenkins
Docker Pull Jenkins
3. Rename Docker image and erase old image
Docker Tag Docker.io/jenkins Jenkins
Docker RMI Docker.io/jenkins
4. Close SELinux
Because SELinux prevents Docker from accessing the mounted local directory
5. Create a container's mapping directory (such as:/var/jenkins_home) and modify the directory permission to 777 so that the container can be mounted in the container, the mount point is/var/jenkins_home, write the configuration file started by the container to the mount point, So that you can view the configuration file and log of the operation container externally
4 and 5 steps can be implemented through the addition of parameter--privileged=true Docker container can access the host of any directory
6. Create a container
Docker run-d-P 8080:8080-p 50000:50000-v/var/jenkins_home:/var/jenkins--name Jenkins Jenkins