From a96035d094c6a10795c4492b130b3a7fe84cd0c4 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 24 Aug 2021 15:57:01 +0000 Subject: [PATCH] centos6 docker image builder for jenkins --- docker-jenkins/Dockerfile.centos6 | 1 + docker-jenkins/build-initial-centos6.sh | 10 +++++-- docker-jenkins/centos6-eol.repo | 40 +++++++++++++++++++++++++ docker-jenkins/readme.txt | 4 +++ 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 docker-jenkins/centos6-eol.repo create mode 100644 docker-jenkins/readme.txt diff --git a/docker-jenkins/Dockerfile.centos6 b/docker-jenkins/Dockerfile.centos6 index bc4b0fe..33c730a 100644 --- a/docker-jenkins/Dockerfile.centos6 +++ b/docker-jenkins/Dockerfile.centos6 @@ -1,6 +1,7 @@ FROM centos:centos6 COPY build-initial-centos6.sh /tmp +COPY centos6-eol.repo /etc/yum.repos.d/ RUN /tmp/build-initial-centos6.sh && rm -rf /tmp/* CMD ["/usr/sbin/sshd -D"] diff --git a/docker-jenkins/build-initial-centos6.sh b/docker-jenkins/build-initial-centos6.sh index daa8f8e..e872609 100644 --- a/docker-jenkins/build-initial-centos6.sh +++ b/docker-jenkins/build-initial-centos6.sh @@ -1,8 +1,12 @@ cd /tmp -apt-get update && -yum install -y - openssh-server openssh-client openjdk-11-jdk openjdk-11-jre \ +rm -f /etc/yum.repos.d/CentOS-*.repo && +yum -y update && +yum -y install \ + openssh-server openssh-clients java-1.8.0-openjdk java-1.8.0-openjdk-devel \ gcc gcc-c++ gcc-gnat gcc-java make autoconf automake libtool vim-enhanced && useradd -m -s /bin/bash jenkins && +sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd && +RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key && +RUN ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key && mkdir -p /var/run/sshd diff --git a/docker-jenkins/centos6-eol.repo b/docker-jenkins/centos6-eol.repo new file mode 100644 index 0000000..80a3e99 --- /dev/null +++ b/docker-jenkins/centos6-eol.repo @@ -0,0 +1,40 @@ +[C6.10-base] +name=CentOS-6.10 - Base +baseurl=http://vault.centos.org/6.10/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +enabled=1 +metadata_expire=never + +[C6.10-updates] +name=CentOS-6.10 - Updates +baseurl=http://vault.centos.org/6.10/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +enabled=1 +metadata_expire=never + +[C6.10-extras] +name=CentOS-6.10 - Extras +baseurl=http://vault.centos.org/6.10/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +enabled=1 +metadata_expire=never + +[C6.10-contrib] +name=CentOS-6.10 - Contrib +baseurl=http://vault.centos.org/6.10/contrib/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +enabled=0 +metadata_expire=never + +[C6.10-centosplus] +name=CentOS-6.10 - CentOSPlus +baseurl=http://vault.centos.org/6.10/centosplus/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +enabled=0 +metadata_expire=never + diff --git a/docker-jenkins/readme.txt b/docker-jenkins/readme.txt new file mode 100644 index 0000000..9a8d8df --- /dev/null +++ b/docker-jenkins/readme.txt @@ -0,0 +1,4 @@ +docker run -d -p 9922:22 --name=debian-jenkins-agent --restart=unless-stopped debian-jenkins:latest /usr/sbin/sshd -D + +docker run -d -p 9923:22 --name=centos6-jenkins-agent --restart=unless-stopped centos6-jenkins:latest /usr/sbin/sshd -D +