Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unixPB: add new dockerstatic container for Redhat UBI8 #2532 #2557

Merged
merged 5 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM redhat/ubi8
# Install Base Requirements
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Haroon-Khel marked this conversation as resolved.
Show resolved Hide resolved
RUN dnf -y update && dnf install -y perl openssh-server unzip wget epel-release
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -P ""
# Install Additional Repos
RUN wget 'http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm' -O /tmp/gpgkey.rpm
RUN rpm -i '/tmp/gpgkey.rpm'
RUN wget 'http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm' -O /tmp/centosrepos.rpm
RUN rpm -i '/tmp/centosrepos.rpm'
# Install java8 via WGET
RUN wget -q 'https://api.adoptium.net/v3/binary/latest/8/ga/linux/x64/jdk/hotspot/normal/eclipse?project=jdk' -O /tmp/jdk8.tar.gz
RUN mkdir -p /usr/lib/jvm/jdk8 && tar -xpzf /tmp/jdk8.tar.gz -C /usr/lib/jvm/jdk8 --strip-components=1
# Install ant via WGET
RUN wget -q -O /tmp/ant.zip 'https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.zip'
steelhead31 marked this conversation as resolved.
Show resolved Hide resolved
RUN wget -q -O /tmp/ant-contrib.tgz https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.tar.gz
RUN echo "2e48f9e429d67708f5690bc307232f08440d01ebe414059292b6543971da9c7cd259c21533b9163b4dd753321c17bd917adf8407d03245a0945fc30a4e633163 /tmp/ant.zip" > /tmp/ant.sha512
RUN echo "0fd2771dca2b8b014a4cb3246715b32e20ad5d26754186d82eee781507a183d5e63064890b95eb27c091c93c1209528a0b18a6d7e6901899319492a7610e74ad /tmp/ant-contrib.tgz" >> /tmp/ant.sha512
RUN sha512sum --check --strict /tmp/ant.sha512
RUN ln -s /usr/local/apache-ant-1.10.5/bin/ant /usr/bin/ant
RUN unzip -q -d /usr/local /tmp/ant.zip
RUN tar xpfz /tmp/ant-contrib.tgz -C /usr/local/apache-ant-1.10.5/lib --strip-components=2 ant-contrib/lib/ant-contrib.jar
# Housekeep Downloaded Archives
RUN rm /tmp/jdk8.tar.gz /tmp/ant.zip /tmp/ant-contrib.tgz /tmp/gpgkey.rpm
# Set up jenkins user
RUN useradd -m -d /home/jenkins jenkins
RUN mkdir /home/jenkins/.ssh
RUN echo "Jenkins_User_SSHKey" > /home/jenkins/.ssh/authorized_keys
RUN chown -R jenkins /home/jenkins/.ssh
RUN chmod -R og-rwx /home/jenkins/.ssh
# RUN service ssh start
CMD ["/usr/sbin/sshd","-D"]
RUN dnf install -y git curl make gcc xorg-x11-server-Xvfb libXrender libXi libXtst fontconfig fakeroot
RUN yum install -y coreutils --allowerasing
# ENTRYPOINT /usr/lib/jvm/jdk8/bin/java
EXPOSE 22
# Start with docker run -p 2222:22 UUID
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ containerIds=$(docker ps -q)
for container in $containerIds
do
OS=$(docker exec -it $container sh -c "cat /etc/os-release" | head -n 1)
if [[ $OS =~ "CentOS" || $OS =~ "Fedora" ]]; then
if [[ $OS =~ "CentOS" || $OS =~ "Fedora" || $OS=~ "Red Hat Enterprise Linux" ]]; then
installCommand="yum -y update"
elif [[ $OS =~ "Ubuntu" ]]; then
installCommand="apt-get update && apt-get -y upgrade"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
- alp312
- alp313
- alp314
- ubi8

##############################################################
# Start the containers #
Expand Down Expand Up @@ -115,6 +116,10 @@
tags: startcontainers
ignore_errors: yes

- name: Start UBI8 container if not already started
command: docker run --restart unless-stopped -p 2235:22 --cpus=2.0 --memory=6G --detach --name ubi8.2235 aqa_ubi8
tags: startcontainers
ignore_errors: yes

# lineinfile does not work here - similar to the operation in /var/log in adopt_etc
# lineinfile: path /proc/sys/kernel/core_pattern state: present: regexp: . line: core.%p
Expand Down