Commit f6fa04f8 authored by Emanuele Usai's avatar Emanuele Usai
Browse files

multistage build and user message for git

parent 2dfb5c70
Pipeline #2447154 failed with stage
in 3 minutes and 32 seconds
......@@ -4,7 +4,7 @@
ARG BASEIMAGE=cern/slc5-base:20190724
# Set up the SLC5 CMSSW base:
FROM ${BASEIMAGE}
FROM ${BASEIMAGE} AS cmssw-base
LABEL maintainer="Clemens Lange <clemens.lange@cern.ch>"
......@@ -53,9 +53,19 @@ RUN wget http://repository.egi.eu/sw/production/cas/1/current/repo-files/EGI
yum install -y HEP_OSlibs_SL5 ca-policy-lcg ca-policy-egi-core wlcg-repo.noarch wlcg-voms-cms && \
yum clean -y all
ENV UPDATE_PATH /opt/patches
RUN mkdir -p ${UPDATE_PATH}
FROM cmssw-base AS git-update
ADD update_script.sh /root/update_script.sh
RUN chmod +x /root/update_script.sh && source /root/update_script.sh
FROM cmssw-base AS slim
COPY --from=git-update ${UPDATE_PATH}/bin ${UPDATE_PATH}/bin
COPY --from=git-update ${UPDATE_PATH}/lib ${UPDATE_PATH}/lib
RUN groupadd -g 1000 cmsusr && adduser -u 1000 -g 1000 -G root cmsusr && \
echo "cmsusr ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers && \
groupadd -g 1001 cmsinst && adduser -u 1001 -g 1001 cmsinst && \
......
......@@ -11,7 +11,11 @@ else
echo "::: /cvmfs/cms.cern.ch/cmsset_default.sh not found/available"
fi
export LD_LIBRARY_PATH=/root/git-inst/lib:${LD_LIBRARY_PATH}
export PATH=/root/git-inst/bin:${PATH}
export LD_LIBRARY_PATH=${UPDATE_PATH}/lib:${LD_LIBRARY_PATH}
export PATH=${UPDATE_PATH}/bin:${PATH}
echo "To use an updated version of git please run the following commands after cmsenv:"
echo "export PATH=\$UPDATE_PATH/bin:\$PATH"
echo "export LD_LIBRARY_PATH=\$UPDATE_PATH/lib:\$LD_LIBRARY_PATH"
exec "$@"
yum -y install make
yum -y groupinstall 'Development Tools'
export INSTALL_DIR=${PWD}/git-inst
export INSTALL_DIR=${UPDATE_PATH}
export GETTEXT_VERSION=gettext-0.20.1
export CURL_VERSION=curl-7.65.0
export OPENSSL_VERSION=openssl-1.1.1g
......@@ -11,7 +11,7 @@ export GIT_VERSION=git-2.21.0
export PERL_VERSION=perl-5.30.2
export LD_LIBRARY_PATH=${INSTALL_DIR}/lib:${LD_LIBRARY_PATH}
export PATH=${INSTALL_DIR}/bin:${PATH}
mkdir ${INSTALL_DIR}
# mkdir -p ${INSTALL_DIR}
cd ${INSTALL_DIR}
wget http://ftp.gnu.org/pub/gnu/gettext/${GETTEXT_VERSION}.tar.gz
......
......@@ -8,4 +8,10 @@ cd ${CMSSW_VERSION}/src
eval `scramv1 runtime -sh`
echo "CMSSW should now be available."
if [[ ${SCRAM_ARCH:3:1} == 5 ]]
then
export LD_LIBRARY_PATH=${UPDATE_PATH}/lib:${LD_LIBRARY_PATH}
export PATH=${UPDATE_PATH}/bin:${PATH}
fi
exec "$@"
Supports Markdown
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