From 5971e18ecd96bcbdfe9d1725ae2df850d445e289 Mon Sep 17 00:00:00 2001 From: Tim Niklas Uhl Date: Wed, 26 Jun 2024 11:40:03 +0200 Subject: [PATCH] Add tbb, cloc and a non-root user to Dockerfile. --- Dockerfile | 51 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8b181ce..fe47674 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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