centos6 docker image builder for jenkins

This commit is contained in:
hyung-hwan 2021-08-24 15:57:01 +00:00
parent d1049204bc
commit a96035d094
4 changed files with 52 additions and 3 deletions

View File

@ -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"]

View File

@ -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

View File

@ -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

View File

@ -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