Skip to content

Commit

Permalink
Add tbb, cloc and a non-root user to Dockerfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
niklas-uhl committed Jun 26, 2024
1 parent 7e57ba6 commit 5971e18
Showing 1 changed file with 40 additions and 11 deletions.
51 changes: 40 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,30 @@ RUN apt-get update && apt-get upgrade -y && \

RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates build-essential pkg-config gnupg libarchive13 openssh-server openssh-client wget net-tools git intel-oneapi-mpi intel-oneapi-mpi-devel && \
ca-certificates build-essential pkg-config gnupg libarchive13 openssh-server openssh-client wget net-tools \
git \
libsparsehash-dev \
intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-tbb-devel && \
rm -rf /var/lib/apt/lists/*

ENV LANG=C.UTF-8
ENV CLASSPATH='/opt/intel/oneapi/mpi/2021.12/share/java/mpi.jar'
ENV CPATH='/opt/intel/oneapi/mpi/2021.12/include'
ENV FI_PROVIDER_PATH='/opt/intel/oneapi/mpi/2021.12/opt/mpi/libfabric/lib/prov:/usr/lib/x86_64-linux-gnu/libfabric'
ENV I_MPI_ROOT='/opt/intel/oneapi/mpi/2021.12'
ENV LD_LIBRARY_PATH="/opt/intel/oneapi/mpi/2021.12/opt/mpi/libfabric/lib:/opt/intel/oneapi/mpi/2021.12/lib:${LD_LIBRARY_PATH}"
ENV LIBRARY_PATH="/opt/intel/oneapi/mpi/2021.12/lib:${LIBRARY_PATH}"
ENV MANPATH='/opt/intel/oneapi/mpi/2021.12/share/man:${MANPATH}'
ENV ONEAPI_ROOT='/opt/intel/oneapi'
ENV PATH="/opt/intel/oneapi/mpi/2021.12/bin:${PATH}"
ENV PKG_CONFIG_PATH="/opt/intel/oneapi/mpi/2021.12/lib/pkgconfig:${PKG_CONFIG_PATH}"
ENV VERSION=latest
ENV CLASSPATH="/opt/intel/oneapi/mpi/${VERSION}/share/java/mpi.jar"
ENV CMAKE_PREFIX_PATH="/opt/intel/oneapi/tbb/${VERSION}"
ENV CPATH="/opt/intel/oneapi/mpi/${VERSION}/include"
ENV CPATH="/opt/intel/oneapi/tbb/${VERSION}/include:${CPATH}"
ENV FI_PROVIDER_PATH="/opt/intel/oneapi/mpi/${VERSION}/opt/mpi/libfabric/lib/prov:/usr/lib/x86_64-linux-gnu/libfabric"
ENV I_MPI_ROOT="/opt/intel/oneapi/mpi/${VERSION}"
ENV LD_LIBRARY_PATH="/opt/intel/oneapi/mpi/${VERSION}/opt/mpi/libfabric/lib:/opt/intel/oneapi/mpi/2021.12/lib:${LD_LIBRARY_PATH}"
ENV LD_LIBRARY_PATH="/opt/intel/oneapi/tbb/${VERSION}/lib${LD_LIBRARY_PATH}"
ENV LIBRARY_PATH="/opt/intel/oneapi/mpi/${VERSION}/lib:${LIBRARY_PATH}"
ENV LIBRARY_PATH="/opt/intel/oneapi/tbb/${VERSION}/lib:${LIBRARY_PATH}"
ENV MANPATH="/opt/intel/oneapi/mpi/${VERSION}/share/man:${MANPATH}"
ENV ONEAPI_ROOT="/opt/intel/oneapi"
ENV PATH="/opt/intel/oneapi/mpi/${VERSION}/bin:${PATH}"
ENV PKG_CONFIG_PATH="/opt/intel/oneapi/mpi/${VERSION}/lib/pkgconfig:${PKG_CONFIG_PATH}"
ENV PKG_CONFIG_PATH="/opt/intel/oneapi/tbb/${VERSION}/lib/pkgconfig:${PKG_CONFIG_PATH}"
ENV TBBROOT="/opt/intel/oneapi/tbb/${VERSION}"
ENV SETVARS_COMPLETED='1'

# KaMPIng specific dependencies
Expand All @@ -51,4 +61,23 @@ RUN apt update -y && apt upgrade -y && \
apt install -y pip && \
pip install pipenv

# Install eval deps
RUN apt update -y && apt upgrade -y && \
apt install -y cloc gawk

# create a user `kamping`
ARG USERNAME=kamping
ARG USER_ID=1000
ARG USER_GID=$USER_ID

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_ID --gid $USER_ID -m $USERNAME \
&& apt update \
&& apt install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

USER $USERNAME
WORKDIR /home/$USERNAME

VOLUME /repro-scripts

0 comments on commit 5971e18

Please sign in to comment.