320x100
320x100
Jenkins Container Docker File
# fc Build Server Container Image
FROM jenkins/jenkins
LABEL maintainer = tlgns7386@gmail.com
LABEL version = 1.0
ENV DEBCONF_NOWARNINGS yes
USER root
# TimeZone Setting
# Docker install
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime \
&& apt-get update \
&& apt-get install -y ca-certificates curl gnupg lsb-release \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update -y \
&& apt-get install -y docker-ce docker-ce-cli containerd.io systemctl \
&& usermod -aG docker root
# should create fc-login.sh before container build
COPY fc-login.sh /usr
# Jenkins Option Save
VOLUME /home/ec2-user/jenkins_home:/var/jenkins_home
Docker 컨테이너 안에서 Docker 사용하기 (Docker out of Docker)
: docker run -d -v /var/run/docker.sock:/var/run/docker.sock
: volumes:
- /var/run/docker.sock:/var/run/docker.sock
컴포즈 파일
version: '3.8'
services:
build_server:
image: 2mukee/fc-build-server:1.0
ports:
- 80:8080
- 50000:50000
environment:
- TZ=Asia/Seoul
volumes:
- /home/ec2-user/jenkins_home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
deploy:
update_config:
delay: 10s
order: start-first
failure_action: rollback
Refference
300x250
728x90
'CICD > Jenkins' 카테고리의 다른 글
WSL2 환경에서 Jenkins 플러그인 업데이트 안될 때 (0) | 2022.05.19 |
---|---|
WSL2.0 환경에서 Jenkins (0) | 2022.03.19 |
[Jenkins] 젠킨스 agent 노드 추가 (젠킨스 분산빌드) (0) | 2021.12.15 |
Jenkins와 Slack 연동 (0) | 2021.11.28 |
JENKINS_HOME is almost full 해결법 (0) | 2021.11.22 |