[root@rmaster02 jenkins]# vim docker-compose.yml
[root@rmaster02 jenkins]#
[root@rmaster02 jenkins]# mkdir -p /data/jenkins
[root@rmaster02 jenkins]# chown -R 1000:1000 /data/jenkins
[root@rmaster02 jenkins]#
[root@rmaster02 jenkins]# docker-compose up -d
Pulling jenkins (jenkins/jenkins:lts)...
lts: Pulling from jenkins/jenkins
3192219afd04: Pull complete
17c160265e75: Pull complete
cc4fe40d0e61: Pull complete
9d647f502a07: Pull complete
d108b8c498aa: Pull complete
1bfe918b8aa5: Pull complete
dafa1a7c0751: Pull complete
8debb2a797ac: Pull complete
b61ee195341b: Pull complete
077a9a7f734d: Pull complete
d98b8fe6b0e0: Pull complete
984b62d17d53: Pull complete
c340331b32a0: Pull complete
4141f86cd682: Pull complete
7a9a3161243a: Pull complete
b82163a85446: Pull complete
2dc7838ff547: Pull complete
783e9f7bc46e: Pull complete
19c6f26bfeba: Pull complete
Digest: sha256:83df661d1a2ad921323868ca48f432b175b039bb9e16be0209c0253f3186f25e
Status: Downloaded newer image for jenkins/jenkins:lts
Creating jenkins ... done
[root@rmaster02 jenkins]# docker-compose ps
Name Command State Ports
------------------------------------------------------------------------------------
jenkins /sbin/tini -- /usr/local/b ... Up 50000/tcp, 0.0.0.0:8029->8080/tcp
[root@rmaster02 jenkins]# docker-compose stop
Stopping jenkins ... done
[root@rmaster02 jenkins]#
[root@rmaster02 jenkins]# vim docker-compose.yml
[root@rmaster02 jenkins]#
[root@rmaster02 jenkins]# docker-compose up -d
Recreating jenkins ... done
[root@rmaster02 jenkins]# docker-compose ps
Name Command State Ports
------------------------------------------------------------------------------------
jenkins /sbin/tini -- /usr/local/b ... Up 50000/tcp, 0.0.0.0:8080->8080/tcp
[root@rmaster02 jenkins]# netstat -lntup
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:38819 0.0.0.0:* LISTEN 2179/kubelet
tcp 0 0 127.0.0.1:10248 0.0.0.0:* LISTEN 2179/kubelet
tcp 0 0 127.0.0.1:10249 0.0.0.0:* LISTEN 2218/kube-proxy
tcp 0 0 127.0.0.1:1514 0.0.0.0:* LISTEN 2123/docker-proxy
tcp 0 0 127.0.0.1:9099 0.0.0.0:* LISTEN 5045/calico-node
tcp 0 0 127.0.0.1:10256 0.0.0.0:* LISTEN 2218/kube-proxy
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1192/sshd
tcp6 0 0 :::9796 :::* LISTEN 30316/node_exporter
tcp6 0 0 :::10250 :::* LISTEN 2179/kubelet
tcp6 0 0 :::10251 :::* LISTEN 14896/kube-schedule
tcp6 0 0 :::6443 :::* LISTEN 2236/kube-apiserver
tcp6 0 0 :::2379 :::* LISTEN 2176/etcd
tcp6 0 0 :::10252 :::* LISTEN 10965/kube-controll
tcp6 0 0 :::2380 :::* LISTEN 2176/etcd
tcp6 0 0 :::8080 :::* LISTEN 121014/docker-proxy
tcp6 0 0 :::80 :::* LISTEN 2300/docker-proxy
tcp6 0 0 :::10257 :::* LISTEN 10965/kube-controll
tcp6 0 0 :::30001 :::* LISTEN 2218/kube-proxy
tcp6 0 0 :::10259 :::* LISTEN 14896/kube-schedule
tcp6 0 0 :::22 :::* LISTEN 1192/sshd
tcp6 0 0 :::30080 :::* LISTEN 2218/kube-proxy
tcp6 0 0 :::30081 :::* LISTEN 2218/kube-proxy
udp 0 0 0.0.0.0:8472 0.0.0.0:* -
[root@rmaster02 jenkins]#
[root@rmaster02 jenkins]# docker ps |grep jenkins
e7d72f727eb0 jenkins/jenkins:lts "/sbin/tini -- /usr/…" 4 minutes ago Up 4 minutes 0.0.0.0:8080->8080/tcp, 50000/tcp jenkins
[root@rmaster02 jenkins]# docker exec -it e7d7 bash
root@e7d72f727eb0:/# cat /var/jenkins_home/secrets/initialAdminPassword
6d4f1f25ed1944ef8ca57cfec79b3003
root@e7d72f727eb0:/#
部署安装推荐插件