|
| 1 | +FROM ubuntu:22.04 AS apt-installs |
| 2 | + |
| 3 | +# Install minimal tools required to fetch the rest |
| 4 | +RUN set -ex ; \ |
| 5 | + export DEBIAN_FRONTEND=noninteractive ; \ |
| 6 | + apt update -qq ; \ |
| 7 | + # wget to download repository keys and CMake tarballs |
| 8 | + # software-properties-common for the apt-add-repository command |
| 9 | + apt install -y -qq wget software-properties-common ; \ |
| 10 | + # clean up apt temporary files |
| 11 | + rm -rf /var/cache/apt/archives /var/lib/apt/lists/* |
| 12 | + |
| 13 | +# Register new repositories |
| 14 | +RUN set -ex ; \ |
| 15 | + export DEBIAN_FRONTEND=noninteractive ; \ |
| 16 | + apt update -qq ; \ |
| 17 | + # Latest Git can be fethed from official PPA |
| 18 | + apt-add-repository -y ppa:git-core/ppa ; \ |
| 19 | + # Canonical hosts recent GCC compilers in ubuntu-toolchain-r/test |
| 20 | + apt-add-repository -y ppa:ubuntu-toolchain-r/test ; \ |
| 21 | + # LLVM hosts most toolchain in separate repos. We only register those absent from ubuntu-toolchain-r/test |
| 22 | + wget -q -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - ; \ |
| 23 | + apt-add-repository -y 'deb [arch=amd64] https://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main' ; \ |
| 24 | + # clean up apt temporary files |
| 25 | + rm -rf /var/cache/apt/archives /var/lib/apt/lists/* |
| 26 | + |
| 27 | +# Install various build tools |
| 28 | +RUN set -ex ; \ |
| 29 | + export DEBIAN_FRONTEND=noninteractive ; \ |
| 30 | + apt update -qq ; \ |
| 31 | + # ninja, git to download dependencies and build-essential to get linkers, etc. |
| 32 | + # ca-certificates to `git clone` via HTTPS |
| 33 | + # libidn11 which only CMake 3.1.3 depends on, need to symlink version 12 from system repo |
| 34 | + # ruby to run CMock |
| 35 | + apt install -y -qq build-essential ninja-build git ca-certificates libidn12 ruby ; \ |
| 36 | + ln -s /usr/lib/x86_64-linux-gnu/libidn.so.12.6.3 /usr/lib/x86_64-linux-gnu/libidn.so.11 ; \ |
| 37 | + # clean up apt temporary files |
| 38 | + rm -rf /var/cache/apt/archives /var/lib/apt/lists/* |
| 39 | + |
| 40 | +# Install GCC |
| 41 | +RUN set -ex ; \ |
| 42 | + export DEBIAN_FRONTEND=noninteractive ; \ |
| 43 | + apt update -qq ; \ |
| 44 | + apt install -y -qq g++-11 g++-13 g++-11-multilib g++-13-multilib ; \ |
| 45 | + # clean up apt temporary files |
| 46 | + rm -rf /var/cache/apt/archives /var/lib/apt/lists/* |
| 47 | + |
| 48 | +# Install LLVM |
| 49 | +RUN set -ex ; \ |
| 50 | + export DEBIAN_FRONTEND=noninteractive ; \ |
| 51 | + apt update -qq ; \ |
| 52 | + apt install -y -qq clang-14 clang-16 ; \ |
| 53 | + # clean up apt temporary files |
| 54 | + rm -rf /var/cache/apt/archives /var/lib/apt/lists/* |
| 55 | + |
| 56 | +# Install SFML dependencies |
| 57 | +RUN set -ex ; \ |
| 58 | + export DEBIAN_FRONTEND=noninteractive ; \ |
| 59 | + apt update -qq ; \ |
| 60 | + # alsa: autoconf libtool pkg-config |
| 61 | + # glew: libxmu-dev libxi-dev libgl-dev @ vcpkg install-time |
| 62 | + # libglu1-mesa-dev @ cmake configure-time |
| 63 | + # sfml: libudev-dev libx11-dev libxrandr-dev libxcursor-dev |
| 64 | + apt install -y -qq autoconf libtool pkg-config libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev libudev-dev libx11-dev libxrandr-dev libxcursor-dev ; \ |
| 65 | + # clean up apt temporary files |
| 66 | + rm -rf /var/cache/apt/archives /var/lib/apt/lists/* |
| 67 | + |
| 68 | +# Install Vcpkg dependencies |
| 69 | +RUN set -ex ; \ |
| 70 | + export DEBIAN_FRONTEND=noninteractive ; \ |
| 71 | + apt update -qq ; \ |
| 72 | + # alsa: autoconf libtool |
| 73 | + apt install -y -qq curl zip unzip tar ; \ |
| 74 | + # clean up apt temporary files |
| 75 | + rm -rf /var/cache/apt/archives /var/lib/apt/lists/* |
| 76 | + |
| 77 | +# Install CMake minimum (3.0.2 (Headers, ICD Loader), 3.1.3 (CLHPP), 3.10.3 (SDK)) and latest (3.26.4) |
| 78 | +RUN mkdir -p /opt/Kitware/CMake ; \ |
| 79 | + wget -c https://github.com/Kitware/CMake/releases/download/v3.0.2/cmake-3.0.2-Linux-i386.tar.gz -O - | tar -xz --directory /opt/Kitware/CMake ; \ |
| 80 | + mv /opt/Kitware/CMake/cmake-3.0.2-Linux-i386 /opt/Kitware/CMake/3.0.2 ; \ |
| 81 | + wget -c https://github.com/Kitware/CMake/releases/download/v3.1.3/cmake-3.1.3-Linux-x86_64.tar.gz -O - | tar -xz --directory /opt/Kitware/CMake ; \ |
| 82 | + mv /opt/Kitware/CMake/cmake-3.1.3-Linux-x86_64 /opt/Kitware/CMake/3.1.3 ; \ |
| 83 | + wget -c https://github.com/Kitware/CMake/releases/download/v3.10.3/cmake-3.10.3-Linux-x86_64.tar.gz -O - | tar -xz --directory /opt/Kitware/CMake ; \ |
| 84 | + mv /opt/Kitware/CMake/cmake-3.10.3-Linux-x86_64 /opt/Kitware/CMake/3.10.3 ; \ |
| 85 | + wget -c https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-x86_64.tar.gz -O - | tar -xz --directory /opt/Kitware/CMake ; \ |
| 86 | + mv /opt/Kitware/CMake/cmake-3.26.4-linux-x86_64 /opt/Kitware/CMake/3.26.4 |
| 87 | + |
| 88 | +# Install Vcpkg |
| 89 | +RUN git clone --depth 1 https://github.com/Microsoft/vcpkg.git /opt/Microsoft/vcpkg ; \ |
| 90 | + /opt/Microsoft/vcpkg/bootstrap-vcpkg.sh ; \ |
| 91 | + # install SFML, TCLAP, GLM, GLEW |
| 92 | + /opt/Microsoft/vcpkg/vcpkg install sfml tclap glm glew ; \ |
| 93 | + rm -rf /opt/Microsoft/vcpkg/buildtrees ; \ |
| 94 | + rm -rf /opt/Microsoft/vcpkg/downloads |
0 commit comments