Skip to content
Snippets Groups Projects

feat: py-minkowskiengine

Closed Wouter Deconinck requested to merge wdconinc-master-patch-02750 into master
Compare and Show latest version
27 files
+ 1550
1306
Compare changes
  • Side-by-side
  • Inline
Files
27
#syntax=docker/dockerfile:1.2
ARG BASE_IMAGE="amd64/debian:testing-20220822-slim"
ARG BUILD_IMAGE="debian_base"
#syntax=docker/dockerfile:1.4
ARG BASE_IMAGE="amd64/debian:stable-slim"
ARG BUILD_IMAGE="debian_stable_base"
# Minimal container based on Debian base systems for up-to-date packages.
FROM ${BASE_IMAGE}
@@ -10,6 +10,10 @@ LABEL maintainer="Sylvester Joosten <sjoosten@anl.gov>" \
COPY bashrc /root/.bashrc
## With heredocs for multi-line scripts, we want to fail on error and the print failing line.
## Ref: https://docs.docker.com/engine/reference/builder/#example-running-a-multi-line-script
SHELL ["bash", "-ex", "-c"]
ENV CLICOLOR_FORCE=1 \
LANGUAGE=en_US.UTF-8 \
LANG=en_US.UTF-8 \
@@ -17,13 +21,13 @@ ENV CLICOLOR_FORCE=1 \
## Install additional packages. Remove the auto-cleanup functionality
## for docker, as we're using the new buildkit cache instead.
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean \
&& ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime \
&& echo "US/Eastern" > /etc/timezone \
&& apt-get -yqq update \
&& apt-get -yqq install --no-install-recommends \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked <<EOF
rm -f /etc/apt/apt.conf.d/docker-clean
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
echo "US/Eastern" > /etc/timezone
apt-get -yqq update
apt-get -yqq install --no-install-recommends \
bc \
bzip2 \
ca-certificates \
@@ -41,9 +45,13 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
less \
libcbor-xs-perl \
libjson-xs-perl \
libgl-dev \
libglx-dev \
libopengl-dev \
locales \
lua-posix \
make \
moreutils \
nano \
openssh-client \
parallel \
@@ -51,50 +59,62 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
poppler-utils \
time \
unzip \
valgrind \
vim-nox \
wget \
&& apt-get -yqq autoremove \
&& localedef -i en_US -f UTF-8 en_US.UTF-8
wget
apt-get -yqq autoremove
localedef -i en_US -f UTF-8 en_US.UTF-8
EOF
# Install updated compilers, with support for multiple base images
## Ubuntu: latest gcc from toolchain ppa, latest stable clang
## Debian: default gcc with distribution, latest stable clang
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
. /etc/os-release \
&& mkdir -p /etc/apt/source.list.d \
&& if [ "${ID}" = "ubuntu" ] ; then \
echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu/ \
${VERSION_CODENAME} main" \
> /etc/apt/source.list.d/ubuntu-toolchain.list \
&& if [ "${VERSION_ID}" = "20.04" ] ; then GCC="-10" CLANG="-12" ; fi\
&& if [ "${VERSION_ID}" = "22.04" ] ; then GCC="-12" CLANG="-14" ; fi\
&& curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -\
&& echo "deb http://apt.llvm.org/${VERSION_CODENAME} \
llvm-toolchain-${VERSION_CODENAME}${CLANG} main" \
> /etc/apt/source.list.d/llvm.list \
&& apt-get -yqq update \
&& apt-get -yqq install \
gcc${GCC} g++${GCC} gfortran${GCC} \
&& apt-get -yqq install \
clang${CLANG} clang-tidy${CLANG} clang-format${CLANG} \
&& update-alternatives --install /usr/bin/gcc gcc \
/usr/bin/gcc${GCC} 100 \
&& update-alternatives --install /usr/bin/g++ g++ \
/usr/bin/g++${GCC} 100 \
&& update-alternatives --install /usr/bin/gfortran gfortran \
/usr/bin/gfortran${GCC} 100 \
&& update-alternatives --install /usr/bin/clang clang \
/usr/bin/clang${CLANG} 100 \
&& update-alternatives --install /usr/bin/clang++ clang++ \
/usr/bin/clang++${CLANG} 100 \
; else \
apt-get -yqq update \
&& apt-get -yqq install \
gcc g++ gfortran \
clang clang-tidy clang-format \
; fi \
&& apt-get -yqq autoremove \
&& gcc --version \
&& clang --version
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked <<EOF
. /etc/os-release
mkdir -p /etc/apt/source.list.d
# GCC version and repository
case ${ID} in
debian)
case ${VERSION_CODENAME} in
bookworm) GCC="-12" ;;
trixie) GCC="-13" ;;
*) echo "Unsupported VERSION_CODENAME=${VERSION_CODENAME}" ; exit 1 ;;
esac ;;
ubuntu)
echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu/${VERSION_CODENAME} main" > /etc/apt/source.list.d/ubuntu-toolchain.list
case ${VERSION_CODENAME} in
focal) GCC="-10" ;;
jammy) GCC="-12" ;;
*) echo "Unsupported VERSION_CODENAME=${VERSION_CODENAME}" ; exit 1 ;;
esac ;;
*) echo "Unsupported ID=${ID}" ; exit 1 ;;
esac
# Clang version and repository
CLANG="-16"
curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
if [ ${VERSION_CODENAME} = trixie ] ; then
echo "deb http://apt.llvm.org/unstable llvm-toolchain${CLANG} main" > /etc/apt/sources.list.d/llvm.list
else
echo "deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME}${CLANG} main" > /etc/apt/sources.list.d/llvm.list
fi
# Install packages
apt-get -yqq update
apt-get -yqq install gcc${GCC} g++${GCC} gfortran${GCC}
apt-get -yqq install clang${CLANG} clang-tidy${CLANG} clang-format${CLANG} libclang${CLANG}-dev
apt-get -yqq autoremove
# Ensure alternatives without version tags
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp${GCC} 100
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc${GCC} 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++${GCC} 100
update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran${GCC} 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang${CLANG} 100
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++${CLANG} 100
update-alternatives --install /usr/bin/clang-tidy-diff clang-tidy-diff /usr/bin/clang-tidy-diff${CLANG}.py 100
update-alternatives --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy${CLANG}.py 100
# Default to gcc
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 100
update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 100
# Check versions
gcc --version
clang --version
EOF
Loading