1.jenkins 기본 이미지를 가져오는 Dockerfile 을 만든다
FROM jenkins/jenkins:lts
MAINTAINER amola@amola.co.kr
USER root
RUN apt-get update && \
apt-get -y install apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common && \
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey && \
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
$(lsb_release -cs) \
stable" && \
apt-get update && \
apt-get -y install docker-ce
VOLUME /var/android_sdk
# install jenkins plugins
COPY mydummyplugins.txt /usr/share/jenkins/ref/mydummyplugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/mydummyplugins.txt
#Update the username and password
ENV JENKINS_USER admin
ENV JENKINS_PASS ThisIs@StrongP@ssword
Result
ace-editor ant antisamy-markup-formatter apache-httpcomponents-client-4-api bootstrap4-api bouncycastle-api branch-api build-timeout checks-api cloudbees-folder command-launcher config-file-provider credentials-binding
...
이렇게 나오는데, 이걸 복사해서 로컬의 mydummyplugins.txt 에 복사해서 넣는다.
mydummyplugins
-------------------
ace-editor ant antisamy-markup-formatter apache-httpcomponents-client-4-api bootstrap4-api bouncycastle-api ...........
-------------
https://web.plus-idea.net/2019/07/plugin-pre-installed-jenkins-docker/
https://www.digitalocean.com/community/tutorials/how-to-automate-jenkins-setup-with-docker-and-jenkins-configuration-as-code
감사요!
docker build -t jenkinstest/myjenkins:1.0 .
version: '3'
services:
jenkins:
build:
context: .
dockerfile: Dockerfile
container_name: 'jenkins_docker_myjenkins'
restart: always
ports:
- '8200:8080'
- '50200:50000'
expose:
- '8080'
- '50000'
volumes:
- /var/jenkins_home
- /var/android_sdk
docker run -d \
-p 8082:8080 \
-v ~/docker_share:/var/jenkins_home \
-v ~/Library/Android/sdk:/var/android_sdk \
--name tesetdel2 \
jenkinstest/myjenkins:1.0
sudo docker-compose up -d
0 comments:
댓글 쓰기