diff --git a/lazyDir/centos7.Dockerfile b/lazyDir/centos7.Dockerfile index 2758a5b..2e37e78 100644 --- a/lazyDir/centos7.Dockerfile +++ b/lazyDir/centos7.Dockerfile @@ -77,20 +77,6 @@ && \ yum -q -y clean all --enablerepo='*' -# Install extra java deps -ARG jdk=1.8.0 -RUN yum -q clean expire-cache && \ - yum -q -y update && \ - yum -y install --setopt=tsflags=nodocs \ - tzdata-java \ - java-${jdk}-openjdk-devel \ - && \ - yum -q -y clean all --enablerepo='*' - -# Create a symbolic link to latest JVM - for legacy scripts -RUN mkdir /usr/java && \ - ln -s /usr/lib/jvm/java-${jdk}-openjdk /usr/java/latest - # Install NodeJS 10 from SCLO repo RUN yum -q clean expire-cache && \ yum -q -y update && \ @@ -103,8 +89,9 @@ # Enable SCLs for any later bash session # The script can also be sourced if the entry-point is overwritten COPY enable-scl.sh /usr/local/bin/scl_enable -RUN chmod 0755 /usr/local/bin/scl_enable -ENTRYPOINT [ "/usr/local/bin/scl_enable" ] +COPY container-entrypoint.sh /usr/local/bin/container-entrypoint +RUN chmod 0755 /usr/local/bin/container-entrypoint +ENTRYPOINT [ "/usr/local/bin/container-entrypoint" ] ENV BASH_ENV="/usr/local/bin/scl_enable" \ ENV="/usr/local/bin/scl_enable" \ PROMPT_COMMAND=". /usr/local/bin/scl_enable" @@ -114,6 +101,20 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ echo $TZ > /etc/timezone +# Install JDK +ARG jdk=1.8.0 +RUN yum -q clean expire-cache && \ + yum -q -y update && \ + yum -y install --setopt=tsflags=nodocs \ + tzdata-java \ + java-${jdk}-openjdk-devel \ + && \ + yum -q -y clean all --enablerepo='*' + +# Create a symbolic link to latest JVM - for legacy scripts +RUN mkdir /usr/java && \ + ln -s /usr/lib/jvm/java-${jdk}-openjdk /usr/java/latest + # Parameters for default user:group ARG uid=1000 ARG user=android @@ -134,7 +135,7 @@ # Install Fastlane for this user RUN source /usr/local/bin/scl_enable && \ - echo "gem: --no-document --user-install --bindir /home/android/bin" >> /home/${user}/.gemrc && \ + echo "gem: --no-document --user-install --bindir /home/${user}/bin" >> /home/${user}/.gemrc && \ echo "gempath: /home/${user}/.gem/ruby:/home/${user}/.bundle/gems/ruby/2.6.0:/opt/rh/rh-ruby26/root/usr/share/gems" >> .gemrc && \ gem install bundler --version `sed -n -r -e '/BUNDLED WITH/,$ { s/\s+([.0-9]+)/\1/ p }' Gemfile.lock` && \ bundle config --global path /home/${user}/.bundle/gems && \ diff --git a/lazyDir/container-entrypoint.sh b/lazyDir/container-entrypoint.sh new file mode 100644 index 0000000..2260a67 --- /dev/null +++ b/lazyDir/container-entrypoint.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +source /usr/local/bin/enable-scl + +# Configure bash behavior +set -o errexit # exit on failed command +set -o nounset # exit on undeclared variables +set -o pipefail # exit on any failed command in pipes +#set -o xtrace # to debug + +# Expand arguments as command +exec "$@" diff --git a/lazyDir/enable-scl.sh b/lazyDir/enable-scl.sh index a1547e9..d931926 100755 --- a/lazyDir/enable-scl.sh +++ b/lazyDir/enable-scl.sh @@ -1,8 +1,3 @@ -#!/usr/bin/env bash - -# Configure bash behavior -#set -o xtrace # to debug - # Make sure home bin directory is in PATH if ! [[ "${PATH}" =~ "${HOME}/bin" ]]; then export PATH="${HOME}/bin:${PATH}" @@ -10,14 +5,3 @@ # Activate all Software collections - if any IFS=$'\n' SCLS=($(scl --list)) && test ${#SCLS[@]} -eq 0 || source scl_source enable "${SCLS[@]}" - -# Execute arguments as command if requested -if [ "$(basename "${0}")" == "$(basename ${BASH_SOURCE[0]})" -a ${#} -gt 0 ]; then - # Configure bash behavior - set -o errexit # exit on failed command - set -o nounset # exit on undeclared variables - set -o pipefail # exit on any failed command in pipes - - # Expand arguments as command - exec "${@}" -fi