728x90
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
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
43cbf881466b49de929277fb677c833a
$ 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
'리눅스' 카테고리의 다른 글
[draft] CentOS 7에서 Chrony 설치 및 설정 방법 (0) | 2021.06.17 |
---|---|
[리눅스] OpenLDAP 설치 및 구성 (0) | 2021.06.11 |
Ansible setup 모듈(setup module)을 사용하는 방법 (0) | 2021.06.05 |
zsh 프롬프트 전체 경로 대신 현재 디렉터리만 표시하는 방법 (0) | 2021.06.05 |
[draft] sipcalc 명령어 (0) | 2021.06.05 |