From 2ed10ec15275b7111f5bc9bd264660eb76ec04ab Mon Sep 17 00:00:00 2001 From: Colton Mills Date: Tue, 20 Nov 2018 10:34:08 -0800 Subject: [PATCH] Added ubuntu18 ppc64le Dockerfile Added new dockerfile to create ubuntu18 docker containers for testing purposes only. [skip ci] Signed-off-by: Colton Mills --- .../docker-slaves/ppc64le/ubuntu18/Dockerfile | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 buildenv/jenkins/docker-slaves/ppc64le/ubuntu18/Dockerfile diff --git a/buildenv/jenkins/docker-slaves/ppc64le/ubuntu18/Dockerfile b/buildenv/jenkins/docker-slaves/ppc64le/ubuntu18/Dockerfile new file mode 100644 index 00000000000..a6cb06989b2 --- /dev/null +++ b/buildenv/jenkins/docker-slaves/ppc64le/ubuntu18/Dockerfile @@ -0,0 +1,90 @@ +# Copyright (c) 2018, 2018 IBM Corp. and others +# +# This program and the accompanying materials are made available under +# the terms of the Eclipse Public License 2.0 which accompanies this +# distribution and is available at https://www.eclipse.org/legal/epl-2.0/ +# or the Apache License, Version 2.0 which accompanies this distribution and +# is available at https://www.apache.org/licenses/LICENSE-2.0. +# +# This Source Code may also be made available under the following +# Secondary Licenses when the conditions for such availability set +# forth in the Eclipse Public License, v. 2.0 are satisfied: GNU +# General Public License, version 2 with the GNU Classpath +# Exception [1] and GNU General Public License, version 2 with the +# OpenJDK Assembly Exception [2]. +# +# [1] https://www.gnu.org/software/classpath/license.html +# [2] http://openjdk.java.net/legal/assembly-exception.html +# +# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + +# To use this docker file: +# First copy your public ssh key into a file named authorized_keys next to the Dockerfile +# Then include a known_hosts file next to the Dockerfile, with github as a saved host +# This can be done with "ssh-keyscan github.com >> path_to_dockerfile/known_hosts" +# Make sure you are in the directory contianing the Dockerfile, authorized_keys file, and known_hosts file +# Then run: +# docker build -t openj9 -f Dockerfile . +# docker run -it openj9 + +FROM ubuntu:18.04 + +# Install required OS tools + +ENV USER="jenkins" + +RUN apt-get update \ + && apt-get install -qq -y --no-install-recommends \ + software-properties-common \ + && add-apt-repository ppa:ubuntu-toolchain-r/test \ + && apt-get update \ + && apt-get install -qq -y --no-install-recommends \ + ant \ + ant-contrib \ + autoconf \ + build-essential \ + curl \ + g++-4.8 \ + g++-7 \ + gcc-4.8 \ + gcc-7 \ + gdb \ + git \ + openssh-client \ + openssh-server \ + perl \ + ssh \ + wget \ + && rm -rf /var/lib/apt/lists/* + +# Install Docker module to run test framework +RUN echo yes | cpan install JSON Text::CSV + +# Create links for c++,g++,cc,gcc +RUN rm /usr/bin/c++ /usr/bin/g++ /usr/bin/cc /usr/bin/gcc \ + && ln -s g++ /usr/bin/c++ \ + && ln -s g++-4.8 /usr/bin/g++ \ + && ln -s gcc /usr/bin/cc \ + && ln -s gcc-4.8 /usr/bin/gcc + +# Add user home/USER and copy authorized_keys and known_hosts +RUN useradd -ms /bin/bash ${USER} \ + && mkdir /home/${USER}/.ssh/ +COPY authorized_keys /home/${USER}/.ssh/authorized_keys +COPY known_hosts /home/${USER}/.ssh/known_hosts +RUN chown -R ${USER}:${USER} /home/${USER} \ + && chmod 644 /home/${USER}/.ssh/authorized_keys \ + && chmod 644 /home/${USER}/.ssh/known_hosts \ + && chmod 700 /home/${USER}/.ssh + +# Set up sshd config +RUN mkdir /var/run/sshd \ + && sed -i 's/#PermitRootLogin/PermitRootLogin/' /etc/ssh/sshd_config \ + && sed -i 's/#RSAAuthentication.*/RSAAuthentication yes/' /etc/ssh/sshd_config \ + && sed -i 's/#PubkeyAuthentication.*/PubkeyAuthentication yes/' /etc/ssh/sshd_config + +# SSH login fix. Otherwise user is kicked off after login +RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd + +# Expose SSH port and run SSH +EXPOSE 22