Commit 6895348d authored by Marian Heil's avatar Marian Heil

Docker with clang & ubuntu

parent e5d2b553
FROM ubuntu AS base
LABEL name "compilerenv"
# Ubuntu:
RUN apt-get -y update && apt-get -y install tar wget file cmake deltarpm make \
python python-dev git autoconf libtool libgsl-dev zlib1g-dev libstdc++-7-dev \
libtinfo-dev && apt-get -y clean
# installing tzdata needs timezone
RUN export DEBIAN_FRONTEND=noninteractive && apt-get -y install tzdata \
&& ln -fs /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime \
&& dpkg-reconfigure --frontend noninteractive tzdata && apt-get -y clean
RUN ln -s $(which cmake) /usr/bin/cmake3
# Fedora:
# RUN yum -y update && yum -y install tar wget file which cmake3 deltarpm make \
# python2 python2-devel git autoconf libtool gsl-devel zlib-devel libstdc++-devel \
# tzdata && yum -y clean all
ENV MAIN_PREFIX /cvmfs/pheno.egi.eu/HEJ
COPY .bash_profile /root/.bash_profile
COPY .bashrc /root/.bashrc
COPY main_env.sh $MAIN_PREFIX/main_env.sh
ENV CLANG_PREFIX $MAIN_PREFIX/clang_9
# Build docker
FROM base AS builder
# Ubuntu:
RUN . /root/.bashrc \
&& apt-get -y install bzip2 tcl expect dejagnu binutils xz-utils build-essential
# Fedora:
# RUN . /root/.bashrc \
# && yum -y install bzip2 tcl expect dejagnu binutils
ENV T_CLANG_VERSION 9.0.0
ENV T_CLANG_NAME clang+llvm-${T_CLANG_VERSION}-x86_64-linux-gnu-ubuntu-18.04
ENV LANG C.UTF-8
# Install clang
WORKDIR $CLANG_PREFIX
RUN wget -O- http://releases.llvm.org/${T_CLANG_VERSION}/${T_CLANG_NAME}.tar.xz | \
tar xJ -C . && mv ${T_CLANG_NAME}/* . && rm -rf ${T_CLANG_NAME}
ENV CC $CLANG_PREFIX/bin/clang
ENV CXX $CLANG_PREFIX/bin/clang++
ENV PATH $CLANG_PREFIX/bin:$PATH
ENV LD_LIBRARY_PATH $CLANG_PREFIX/lib64:$CLANG_PREFIX/lib
# create env. file
WORKDIR $CLANG_PREFIX
COPY gccenv.sh $CLANG_PREFIX/clangenv.sh
RUN . /root/.bashrc && sed -i -e "s GCC CLANG g" clangenv.sh
RUN . /root/.bashrc && sed -i -e "s gcc clang g" clangenv.sh
RUN . /root/.bashrc && sed -i -e "s g++ clang++ g" clangenv.sh
RUN . /root/.bashrc && sed -i -e "s CLANG_PREFIX ${CLANG_PREFIX} g" clangenv.sh
RUN . /root/.bashrc && printf 'source '$CLANG_PREFIX'/clangenv.sh\n' >> $MAIN_PREFIX/main_env.sh
# Final docker
FROM base
ENV CC $CLANG_PREFIX/bin/clang
ENV CXX $CLANG_PREFIX/bin/clang++
ENV PATH $CLANG_PREFIX/bin:$PATH
ENV LD_LIBRARY_PATH $CLANG_PREFIX/lib64:$CLANG_PREFIX/lib
COPY --from=builder $CLANG_PREFIX $CLANG_PREFIX
COPY --from=builder $MAIN_PREFIX/main_env.sh $MAIN_PREFIX/main_env.sh
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