概述

Linux/CentOS7系统环境下,体验Docker虚拟化快速部署Java应用,Docker容器化部署Jenkins应用环境搭建,Docker容器化部署相比较在JDK环境下更便捷。

Docker容器化部署JenkinsDocker容器化部署Jenkins

Docker容器化部署Jenkins资源概要

1、VMware Workstation Pro 16

2、CentOS 7(Linux)

3、Docker-1.13.1

4、Jenkins-2.302

一、部署Docker虚拟化环境

[root@master jenkins_home]# yum -y install docker
[root@master jenkins_home]# service docker start
[root@master jenkins_home]# ps -ef|grep docker
[root@master jenkins_home]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since 一 2021-07-19 08:32:10 CST; 2h 24min ago
     Docs: https://docs.docker.com
 Main PID: 1005 (dockerd)
    Tasks: 195
   Memory: 1.0G
   CGroup: /system.slice/docker.service

....

二、Docker容器化部署Jenkins

1、Docker容器拉取Jenkins镜像

## Jenkins官方Docke镜像地址
https://hub.docker.com/r/jenkins/jenkins/tags?page=1&ordering=last_updated

Docker容器化部署Jenkins带端口初始化

[root@master ~]# docker run -d --name jenkins -p 8081:8080 -v /home/jenkins_home:/home/jenkins_home/ jenkins/jenkins

2、Docker容器化部署Jenkins查看拉取镜像

[root@master ~]# docker images | grep jenkins
jenkins/jenkins       latest                63786ca6b18a        5 days ago          566MB

3、查看初始化密码

[root@master ~]# docker exec -i -t 48ff543a8dcd /bin/bash
jenkins@48ff543a8dcd:/$ cat /var/jenkins_home/secrets/initialAdminPassword

600a8528c03344bc9e862c9b56e14d0d

4、前端访问

浏览器访问 http://172.19.19.111:8081/

Jenkins初始化后首界面