Skip to content

Commit

Permalink
Updated Dockerfiles for RHEL and CentOS (#137)
Browse files Browse the repository at this point in the history
* Updated Dockerfiles for RHEL and CentOS

* Updated to pre-cache sonar-scanner

* Fixed perms on sonar-scanner for CentOS

* Remove obsolete SCL references and tooling

* Apply suggested changes

Apply changes requested by @sabre1041.

* Combine RUN statements
  • Loading branch information
InfoSec812 authored and sherl0cks committed Mar 15, 2019
1 parent 308390d commit 0c3deb6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
13 changes: 6 additions & 7 deletions jenkins-slaves/jenkins-slave-npm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@ FROM openshift/jenkins-slave-base-centos7:v3.11
ENV NODEJS_VERSION=10 \
NPM_CONFIG_PREFIX=$HOME/.npm-global \
PATH=$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH \
BASH_ENV=/usr/local/bin/scl_enable \
ENV=/usr/local/bin/scl_enable \
PROMPT_COMMAND=". /usr/local/bin/scl_enable" \
CHROME_BIN=/bin/google-chrome

COPY contrib/bin/scl_enable /usr/local/bin/scl_enable
ADD https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm google-chrome-stable_current_x86_64.rpm

RUN yum install -y centos-release-scl-rh && \
INSTALL_PKGS="rh-nodejs${NODEJS_VERSION} rh-nodejs${NODEJS_VERSION}-npm rh-nodejs${NODEJS_VERSION}-nodejs-nodemon nss_wrapper redhat-lsb libXScrnSaver xdg-utils" && \
RUN curl --silent --location https://rpm.nodesource.com/setup_${NODEJS_VERSION}.x | bash -

RUN INSTALL_PKGS="nodejs redhat-lsb libXScrnSaver xdg-utils liberation-fonts" && \
yum install -y --setopt=tsflags=nodocs \
$INSTALL_PKGS && \
yum -y localinstall \
google-chrome-stable_current_x86_64.rpm && \
rm google-chrome-stable_current_x86_64.rpm && \
rpm -V $INSTALL_PKGS google-chrome-stable && \
yum clean all -y && \
rm -rf /var/cache/yum
rm -rf /var/cache/yum && \
npm install --unsafe-perm -g npm-audit-html npm-audit-ci-wrapper sonar-scanner || cat /home/jenkins/.npm/_logs/*-debug.log && \
sonar-scanner || echo

USER 1001
9 changes: 4 additions & 5 deletions jenkins-slaves/jenkins-slave-npm/Dockerfile.rhel7
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ LABEL com.redhat.component="jenkins-slave-nodejs-rhel7-docker" \
ENV NODEJS_VERSION=10 \
NPM_CONFIG_PREFIX=$HOME/.npm-global \
PATH=$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH \
BASH_ENV=/usr/local/bin/scl_enable \
ENV=/usr/local/bin/scl_enable \
PROMPT_COMMAND=". /usr/local/bin/scl_enable" \
CHROME_BIN=/bin/google-chrome

COPY contrib/bin/scl_enable /usr/local/bin/scl_enable
Expand All @@ -25,12 +22,14 @@ RUN INSTALL_PKGS="rh-nodejs${NODEJS_VERSION} rh-nodejs${NODEJS_VERSION}-npm rh-n
yum install -y --setopt=tsflags=nodocs \
--disablerepo=* \
--enablerepo=rhel-7-server-rpms \
--enablerepo=rhel-server-rhscl-7-rpms \
--enablerepo=rhel-7-server-rhoar-nodejs-10-rpms \
--enablerepo=rhel-7-server-optional-rpms \
--enablerepo=rhel-7-server-extras-rpms \
--enablerepo=google-chrome \
$INSTALL_PKGS && \
yum clean all -y && \
rm -rf /var/cache/yum
rm -rf /var/cache/yum && \
npm install -g npm-audit-html npm-audit-ci-wrapper sonar-scanner && \
sonar-scanner || echo

USER 1001
3 changes: 0 additions & 3 deletions jenkins-slaves/jenkins-slave-npm/contrib/bin/scl_enable

This file was deleted.

0 comments on commit 0c3deb6

Please sign in to comment.