diff --git a/Jenkinsfile b/Jenkinsfile index 8d54f1397bf36ac5299e2f87f8621fe5989f7da7..1de1940061276ce0aea9942a53656e84e82e011b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -79,11 +79,12 @@ pipeline { // ************************ Docker-Conan ******************************* stage('Docker-Conan') { agent { - docker { - image 'ogs6/gcc-conan:latest' + dockerfile { + filename 'Dockerfile.gcc.minimal' + dir 'scripts/docker' label 'docker' - args '-v /home/jenkins/.ccache:/usr/src/.ccache' - alwaysPull true + args '-v ccache:/home/jenkins/cache/ccache -v conan-cache:/home/jenkins/cache/conan' + additionalBuildArgs '--pull' } } steps { @@ -127,11 +128,12 @@ pipeline { // ******************### Docker-Conan-Debug #*************************** stage('Docker-Conan-Debug') { agent { - docker { - image 'ogs6/gcc-conan:latest' + dockerfile { + filename 'Dockerfile.gcc.minimal' + dir 'scripts/docker' label 'docker' - args '-v /home/jenkins/.ccache:/usr/src/.ccache' - alwaysPull true + args '-v /home/jenkins/.ccache:/home/jenkins/.ccache' + additionalBuildArgs '--pull' } } steps { diff --git a/scripts/docker/Dockerfile.gcc.minimal b/scripts/docker/Dockerfile.gcc.minimal new file mode 100644 index 0000000000000000000000000000000000000000..1247aaf637f37e367ae31a58e87ac56691a5803e --- /dev/null +++ b/scripts/docker/Dockerfile.gcc.minimal @@ -0,0 +1,44 @@ +FROM ubuntu:16.04 + +RUN apt-get update && apt-get install -y software-properties-common curl \ + && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ + && curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash \ + && apt-get update \ + && apt-get -y install \ + ccache \ + gcc-4.9 g++-4.9 gcc-4.9-base \ + git git-lfs \ + python-pip \ + sudo \ + unzip + +ENV CC=gcc-4.9 +ENV CXX=g++-4.9 + +RUN python -m pip install --upgrade pip \ + && python -m pip install cmake conan + +# Ninja +RUN curl -L -o ninja-linux.zip https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip \ + && unzip ninja-linux.zip \ + && mv ninja /usr/local/bin/ninja \ + && rm ninja-linux.zip + + # Add user jenkins to the image +RUN adduser --uid 500 --disabled-password --gecos "" jenkins \ + # Add user jenkins to sudoers with NOPASSWD + && echo "jenkins ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \ + # Set password for the jenkins user (you may want to alter this). + && echo "jenkins:jenkins" | chpasswd + +# Should be handled in VTK with x11=True +# RUN apt-get -y install libsm-dev libx11-dev libxext-dev libxt-dev libglu1-mesa-dev + +USER jenkins +ENV CCACHE_DIR=/home/jenkins/cache/ccache +RUN mkdir -p $CCACHE_DIR +ENV CCACHE_MAXSIZE=15G +ENV CCACHE_SLOPPINESS=pch_defines,time_macros +ENV CONAN_USER_HOME=/home/jenkins/cache/conan +WORKDIR /home/jenkins +RUN conan user