1. [root@rmaster02 jenkins]# vim docker-compose.yml
    2. [root@rmaster02 jenkins]#
    3. [root@rmaster02 jenkins]# mkdir -p /data/jenkins
    4. [root@rmaster02 jenkins]# chown -R 1000:1000 /data/jenkins
    5. [root@rmaster02 jenkins]#
    6. [root@rmaster02 jenkins]# docker-compose up -d
    7. Pulling jenkins (jenkins/jenkins:lts)...
    8. lts: Pulling from jenkins/jenkins
    9. 3192219afd04: Pull complete
    10. 17c160265e75: Pull complete
    11. cc4fe40d0e61: Pull complete
    12. 9d647f502a07: Pull complete
    13. d108b8c498aa: Pull complete
    14. 1bfe918b8aa5: Pull complete
    15. dafa1a7c0751: Pull complete
    16. 8debb2a797ac: Pull complete
    17. b61ee195341b: Pull complete
    18. 077a9a7f734d: Pull complete
    19. d98b8fe6b0e0: Pull complete
    20. 984b62d17d53: Pull complete
    21. c340331b32a0: Pull complete
    22. 4141f86cd682: Pull complete
    23. 7a9a3161243a: Pull complete
    24. b82163a85446: Pull complete
    25. 2dc7838ff547: Pull complete
    26. 783e9f7bc46e: Pull complete
    27. 19c6f26bfeba: Pull complete
    28. Digest: sha256:83df661d1a2ad921323868ca48f432b175b039bb9e16be0209c0253f3186f25e
    29. Status: Downloaded newer image for jenkins/jenkins:lts
    30. Creating jenkins ... done
    31. [root@rmaster02 jenkins]# docker-compose ps
    32. Name Command State Ports
    33. ------------------------------------------------------------------------------------
    34. jenkins /sbin/tini -- /usr/local/b ... Up 50000/tcp, 0.0.0.0:8029->8080/tcp
    35. [root@rmaster02 jenkins]# docker-compose stop
    36. Stopping jenkins ... done
    37. [root@rmaster02 jenkins]#
    38. [root@rmaster02 jenkins]# vim docker-compose.yml
    39. [root@rmaster02 jenkins]#
    40. [root@rmaster02 jenkins]# docker-compose up -d
    41. Recreating jenkins ... done
    42. [root@rmaster02 jenkins]# docker-compose ps
    43. Name Command State Ports
    44. ------------------------------------------------------------------------------------
    45. jenkins /sbin/tini -- /usr/local/b ... Up 50000/tcp, 0.0.0.0:8080->8080/tcp
    46. [root@rmaster02 jenkins]# netstat -lntup
    47. Active Internet connections (only servers)
    48. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    49. tcp 0 0 127.0.0.1:38819 0.0.0.0:* LISTEN 2179/kubelet
    50. tcp 0 0 127.0.0.1:10248 0.0.0.0:* LISTEN 2179/kubelet
    51. tcp 0 0 127.0.0.1:10249 0.0.0.0:* LISTEN 2218/kube-proxy
    52. tcp 0 0 127.0.0.1:1514 0.0.0.0:* LISTEN 2123/docker-proxy
    53. tcp 0 0 127.0.0.1:9099 0.0.0.0:* LISTEN 5045/calico-node
    54. tcp 0 0 127.0.0.1:10256 0.0.0.0:* LISTEN 2218/kube-proxy
    55. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1192/sshd
    56. tcp6 0 0 :::9796 :::* LISTEN 30316/node_exporter
    57. tcp6 0 0 :::10250 :::* LISTEN 2179/kubelet
    58. tcp6 0 0 :::10251 :::* LISTEN 14896/kube-schedule
    59. tcp6 0 0 :::6443 :::* LISTEN 2236/kube-apiserver
    60. tcp6 0 0 :::2379 :::* LISTEN 2176/etcd
    61. tcp6 0 0 :::10252 :::* LISTEN 10965/kube-controll
    62. tcp6 0 0 :::2380 :::* LISTEN 2176/etcd
    63. tcp6 0 0 :::8080 :::* LISTEN 121014/docker-proxy
    64. tcp6 0 0 :::80 :::* LISTEN 2300/docker-proxy
    65. tcp6 0 0 :::10257 :::* LISTEN 10965/kube-controll
    66. tcp6 0 0 :::30001 :::* LISTEN 2218/kube-proxy
    67. tcp6 0 0 :::10259 :::* LISTEN 14896/kube-schedule
    68. tcp6 0 0 :::22 :::* LISTEN 1192/sshd
    69. tcp6 0 0 :::30080 :::* LISTEN 2218/kube-proxy
    70. tcp6 0 0 :::30081 :::* LISTEN 2218/kube-proxy
    71. udp 0 0 0.0.0.0:8472 0.0.0.0:* -
    72. [root@rmaster02 jenkins]#

    image.png

    1. [root@rmaster02 jenkins]# docker ps |grep jenkins
    2. e7d72f727eb0 jenkins/jenkins:lts "/sbin/tini -- /usr/…" 4 minutes ago Up 4 minutes 0.0.0.0:8080->8080/tcp, 50000/tcp jenkins
    3. [root@rmaster02 jenkins]# docker exec -it e7d7 bash
    4. root@e7d72f727eb0:/# cat /var/jenkins_home/secrets/initialAdminPassword
    5. 6d4f1f25ed1944ef8ca57cfec79b3003
    6. root@e7d72f727eb0:/#

    image.png

    部署安装推荐插件

    image.png