본문 바로가기
jira, confluence, 도커[패캠챌린지]

패스트캠퍼스 챌린지 27일차: Jenkins 소개 및 설치 #1 실습

by !ㅁㅇㅇㅁ! 2021. 10. 2.

 휴일이 하루 더 붙었다 추가로 완성해야...

 

 우리 부서의 서버컴에 설정된 Jenkins 파이프라인으로 사용할 것 같지만, 일단 로컬에도 실습은 해 보겠다.

(물론 그러므로 docker 컨테이너로 돌릴 것이다)

 

대충 도커 이미지 받아오는 짤.

이렇데 jenkins 이미지를 도커허브에서 받아온 다음,

 

 

ㅇㅇ...

이걸로 바로 Run 때리기에는 이름이 괴상해지니까, 그냥 공식 github 문서대로 가자.

 

 

---------------------------------------------------------------------

Usage

docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts-jdk11

NOTE: read the section Connecting agents below for the role of the 50000 port mapping.

This will store the workspace in /var/jenkins_home. All Jenkins data lives in there - including plugins and configuration. You will probably want to make that an explicit volume so you can manage it and attach to another container for upgrades :

docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts-jdk11

This will automatically create a 'jenkins_home' docker volume on the host machine. Docker volumes retain their content even when the container is stopped, started, or deleted.

NOTE: Avoid using a bind mount from a folder on the host machine into /var/jenkins_home, as this might result in file permission issues (the user used inside the container might not have rights to the folder on the host machine). If you really need to bind mount jenkins_home, ensure that the directory on the host is accessible by the jenkins user inside the container (jenkins user - uid 1000) or use -u some_other_user parameter with docker run.

docker run -d -v jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts-jdk11

this will run Jenkins in detached mode with port forwarding and volume added. You can access logs with command 'docker logs CONTAINER_ID' in order to check first login token. ID of container will be returned from output of command above.

 

---------------------------------------------------------------------

 

핵심은 하나,

docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins

이거다. 참 쉽...지않죠?

 

답변을 긁어보니,

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

97ff12144226443b8d21dbd88c56071c

This may also be found at: /var/jenkins_home/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

역시나 추가로 뭔가 해주라고 열심히 나온다.

 

그리고 들어가보니,

 

어...로컬호스트 8080을 잡아먹었네?

오우 shang;;

그대로 따라하니 가장 중요한 localhost:8080을 잡아먹혔다.

날리고 9090 정도로 변경해서 재적용 해야겠다.

 

 

 

 

계속...

 

 

 

이게 다 돌아가면...

 

 

 

이런 식으로 메인 화면이 나온다.

 

 후... 젠킨스 파이프라인은 팀에서 이미 구축한 것을 쓰니까 JenkinsFile만 복붙하면 되는데,

그냥 과제와 업무하게 나머지 3일짜리 챌린지 주제는 다시 SpringBoot 관련 강의 내용으로 바꿀까?

 

 

 

본 포스팅은 패스트캠퍼스 환급 챌린지 참여를 위해 작성되었습니다.

https://bit.ly/37BpXiC

 

패스트캠퍼스 [직장인 실무교육]

프로그래밍, 영상편집, UX/UI, 마케팅, 데이터 분석, 엑셀강의, The RED, 국비지원, 기업교육, 서비스 제공.

fastcampus.co.kr