반응형
jenkins 도커 컨테이너로 올리기
docker-compose.yml 편집
git clone https://github.com/anti1346/docker-jenkins.git
cd docker-jenkins
vim docker-compose.yml
version: '3'
services:
master:
image: jenkins/jenkins:lts
restart: always
container_name: jenkins
privileged: true
#user: root
#environment:
volumes:
- /usr/share/zoneinfo/Asia/Seoul:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- ./jenkins_home:/var/jenkins_home
ports:
- 8080:8080
- 50000:50000
jenkins_home 퍼미션 설정
chown 1000.1000 jenkins_home
docker-compose 기동
docker-compose up -d
docker-compose ps
$ docker-compose ps
Name Command State Ports
---------------------------------------------------------------------------------------------------
jenkins /sbin/tini -- /usr/local/b ... Up 0.0.0.0:50000->50000/tcp, 0.0.0.0:8080->8080/tcp
관리자 패스워드 확인
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword
$ docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword
43cbf881466b49de929277fb677c833a
docker-compose logs
$ docker-compose logs
jenkins | *************************************************************
jenkins | *************************************************************
jenkins | *************************************************************
jenkins |
jenkins | Jenkins initial setup is required. An admin user has been created and a password generated.
jenkins | Please use the following password to proceed to installation:
jenkins |
jenkins | 43cbf881466b49de929277fb677c833a
jenkins |
jenkins | This may also be found at: /var/jenkins_home/secrets/initialAdminPassword
jenkins |
jenkins | *************************************************************
jenkins | *************************************************************
jenkins | *************************************************************
웹 브라우저에서 관리자 패스워드 입력
컨테이너 쉘 접근
jenkins 계정으로 접근
docker exec -it jenkins bash
root 계정으로 접근
docker exec -it --user root jenkins /bin/bash
docker 명령어로 jenkins 시작
docker run -d -v jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
728x90
반응형
'리눅스' 카테고리의 다른 글
CentOS 7에서 KVM 하이퍼바이저를 설치하는 방법 (0) | 2020.11.18 |
---|---|
자체 서명된 SSL 인증서를 생성(사설 SSL 인증서 생성) (0) | 2020.11.17 |
GoAccess를 설치하고 로그를 분석하는 방법 (0) | 2020.11.17 |
CentOS 7에서 Chrony 설치 및 설정 방법 (0) | 2020.11.16 |
PHP 8.1에서 MongoDB 확장 모듈을 설치하는 방법 (0) | 2020.11.16 |