-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3749 from cwesMills/ubuntu18docker
Added ubuntu18 ppc64le Dockerfile
- Loading branch information
Showing
1 changed file
with
90 additions
and
0 deletions.
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
buildenv/jenkins/docker-slaves/ppc64le/ubuntu18/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |