FROM ubuntu:24.04 AS build1 MAINTAINER Ray Burgemeestre ARG DEBIAN_FRONTEND=noninteractive # This is a workaround for https://stackoverflow.com/questions/71941032/why-i-cannot-run-apt-update-inside-a-fresh-ubuntu22-04 RUN sed -i -e 's/^APT/# APT/' -e 's/^DPkg/# DPkg/' \ /etc/apt/apt.conf.d/docker-clean RUN apt-get update && \ apt-get -y install g++12 git sudo wget gnupg2 && \ apt-get -y install libssl-dev build-essential && \ apt-get -y install vim gdb strace patch && \ \ apt update -y && \ apt-get install -y clang-15 clang-tidy-15 libclang-15-dev clangd-15 lldb-15 lld-15 clangd-15 && \ apt-get install -y libc++-15-dev libc++-15-dev clang-format-15 clang-tidy-15 && \ \ rm -rf /var/lib/apt/lists/* # Install newer CMake to avoid some warnings the "FindBoost" script throws on # more recent versions of boost that the system CMake doesn't now about. # I chose a bloody new boost, so I need to use the latest RC1 (at the time of writing) # EDIT: actually we can get rid of this block, Ubuntu 22.04 has a recent enough version already #RUN wget https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1.tar.gz && \ # tar -zxf cmake-3.24.1.tar.gz && \ # cd cmake-3.24.1 && \ # ./bootstrap && \ # make -j $(nproc) && \ # make install && \ # cd .. && \ # rm -rf cmake-3.24.1 && \ # rm -rf cmake-3.24.1.tar.gz RUN sudo apt-get update && \ sudo apt-get install -y cmake # Install emscripten deps RUN sudo apt-get install -y libsdl2-dev && \ (git clone https://github.com/emscripten-core/emsdk.git || true) && \ cd emsdk && \ ./emsdk install latest && \ ./emsdk activate latest && \ sudo cp -prv ./emsdk_env.sh /etc/profile.d/ # Warmup emscripten (this will pre-fetch SDL2, and cache it) RUN /emsdk/upstream/emscripten/em++ -s WASM=1 -s USE_SDL=2 -s USE_SDL_TTF=2 -O3 /dev/null || true # Fix some weird linker issue CAF build runs into. (fails to link -lc++abi) RUN cp -prv /usr/lib/llvm-15/lib/libc++abi.so.1.0 /usr/lib/llvm-15/lib/libc++abi.so # EDIT: no longer needed! # RUN cp -prv /usr/lib/llvm-14/lib/libunwind.so.1.0 /usr/lib/llvm-14/lib/libunwind.so # Install mold (even faster than gold) (linker) RUN apt install -y mold COPY switch-to-latest-clang /usr/local/bin/switch-to-latest-clang COPY switch-to-latest-gcc /usr/local/bin/switch-to-latest-gcc RUN chmod +x /usr/local/bin/switch-to-latest-clang RUN chmod +x /usr/local/bin/switch-to-latest-gcc RUN apt clean FROM scratch COPY --from=build1 / / CMD "/bin/bash"