Commit c233f746 authored by Joseph Noir's avatar Joseph Noir

Experiment with Dockerfiles pipeline syntax

parent eaea2944
#!/usr/bin/env groovy
node {
checkout scm
docker.withServer('tcp://mobi7.inet.haw-hamburg.de:2376', '674e60ef-6985-48dd-a61c-353806cc7106 (certificate for docker on mobi3 v7 (docker plugin))') {
def dockerfile = 'caf-jenkins-fedora-30'
def image = docker.build("caf-jenkins:fedora-30", "-f ${dockerfile} ./dockerfiles")
image.inside {
stage('Testing') {
steps {
sh 'uname -r'
sh 'cat /etc/os_release'
}
}
}
}
}
/*
pipeline {
agent {
agent {
// Equivalent to "docker build -f Dockerfile.build --build-arg version=1.0.2 ./build/
dockerfile {
filename 'caf-jenkins-fedora-30'
dir 'dockerfile'
label 'my-defined-label'
additionalBuildArgs '--build-arg version=1.0.2'
args '-v /tmp:/tmp'
}
}
}
stages {
stage('Build') {
steps {
sh 'uname -r'
sh 'cat /etc/os_release'
checkout scm
}
}
}
}
*/
/*
@Library('caf-continuous-integration') _
// Default CMake flags for release builds.
......@@ -189,3 +233,4 @@ pipeline {
}
}
}
*/
########################################################
# Dockerfile for Jenkins slave with gcc 9
# Based on Fedora 30
############################################################
FROM fedora:30
MAINTAINER Raphael Hiesgen
# Install Essentials
RUN dnf update -y && \
yum clean all
##################### INSTALL TOOLS ########################
# Install Packages
RUN dnf install -y git \
wget \
make \
openssh-server \
sudo \
java-11-openjdk \
cmake \
docker \
kcov \
gcc gcc-c++ \
clang \
openssl-devel \
libasan \
libubsan \
python-pip \
&& dnf clean all
##################### INSTALL GCOVR #######################
RUN pip install --upgrade gcovr
####################### SETUP SSH #########################
# gen dummy keys, centos doesn't autogen them like ubuntu does
RUN /usr/bin/ssh-keygen -A
# Set SSH Configuration to allow remote logins without /proc write access
RUN sed -ri 's/^session\s+required\s+pam_loginuid.so$/session optional pam_loginuid.so/' \
/etc/pam.d/sshd
# Create Jenkins User
RUN useradd jenkins -m -s /bin/bash
# Add public key for Jenkins login
RUN mkdir /home/jenkins/.ssh
COPY authorized_keys /home/jenkins/.ssh/authorized_keys
RUN chown -R jenkins /home/jenkins
RUN chgrp -R jenkins /home/jenkins
RUN chmod 600 /home/jenkins/.ssh/authorized_keys
RUN chmod 700 /home/jenkins/.ssh
# Add the jenkins user to sudoers
# RUN echo "jenkins ALL=(ALL) ALL" >> etc/sudoers
# Set Name Servers
# COPY /files/resolv.conf /etc/resolv.conf
# Expose SSH port and run SSHD
EXPOSE 22
CMD ["/usr/sbin/sshd","-D"]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment