IT 한길

os : centos8
https://hub.docker.com/_/jenkins/

 

jenkins - Docker Hub

DEPRECATION NOTICE This image has been deprecated in favor of the jenkins/jenkins:lts image provided and maintained by Jenkins Community as part of project's release process. The images found here will receive no further updates after LTS 2.60.x. Please ad

hub.docker.com

1. Jenkins 이미지 다운로드

- docker pull jenkins/jenkins

[root@localhost ~]# docker pull jenkins/jenkins 
Using default tag: latest 
latest: 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 
b2d02276dac1: Pull complete 
2c0d0c8c3efd: Pull complete 
96361a673333: Pull complete 
81c6f1bc405d: Pull complete 
0a46f33b1b25: Pull complete 
30eaf72640cc: Pull complete 
f4b226e89c35: Pull complete 
bb775209c68a: Pull complete 
27df1ec63d52: Pull complete 
229f7473962e: Pull complete 
afd6ff4cc063: Pull complete 
c69f789a4a12: Pull complete 
Digest: sha256:3ee4bd15d77fdc7a784efd468f501a03b9baafad7ae3e3f29381af4653bde870 
Status: Downloaded newer image for jenkins/jenkins:latest 

2. Jenkins 이미지 조회

- docker images

[root@localhost ~]# docker images 
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE 
jenkins/jenkins     latest              6328c71fe374        33 hours ago        659MB 
centos              latest              470671670cac        4 months ago        237MB 
hello-world         latest              bf756fb1ae65        5 months ago        13.3kB

3. Jenkins 컨테이너 실행

- ex : docker run -p 8080:8080 -p 50000:50000 -v /your/home:/var/jenkins_home jenkins

[root@localhost ~]# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
[root@localhost ~]# docker run -d -p 9000:8080 -p 50000:50000 -v /jenkins:/var/jenkins_home --name jenkins -u root jenkins/jenkins
35daffa4efd0a03a2c85090453f8302dc0b4f4df478df9a7df6e8f62d3e0a92d
[root@localhost ~]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                              NAMES
35daffa4efd0        jenkins/jenkins     "/sbin/tini -- /usr/…"   18 seconds ago      Up 16 seconds       0.0.0.0:50000->50000/tcp, 0.0.0.0:9000->8080/tcp   jenkins
[root@localhost ~]#

 

4. Jenkins 로그인

http://192.168.31.100:9000/

 

- 로그인 패스워드 조회

[root@localhost /]# docker exec -it jenkins cat /var/jenkins_home/secrets/initialAdminPassword
b534bce2d0eb4ade8f4563c96dae446e

- 로그인