Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

65 lines
2.4KB

  1. FROM ubuntu:22.04 AS build1
  2. MAINTAINER Ray Burgemeestre
  3. ARG DEBIAN_FRONTEND=noninteractive
  4. # The || true around apt-get update is to workaround a weird issue that only seems to happen
  5. # in gocd CI
  6. # EDIT: it did work, now we have to do the same trick for *all* the apt commands...
  7. # TIP: when testing locally, remove all the || true stuff.... or we'll never find mistakes..
  8. RUN apt-get update || true && \
  9. apt-get -y install g++12 git sudo wget gnupg2 || true && \
  10. apt-get -y install libssl-dev build-essential || true && \
  11. apt-get -y install vim gdb strace patch || true && \
  12. \
  13. apt update -y || true && \
  14. apt-get install -y clang-14 clang-tidy-14 libclang-14-dev clangd-14 lldb-14 lld-14 clangd-14 || true && \
  15. apt-get install -y libc++-14-dev libc++-14-dev clang-format-14 || true && \
  16. \
  17. rm -rf /var/lib/apt/lists/*
  18. # Install newer CMake to avoid some warnings the "FindBoost" script throws on
  19. # more recent versions of boost that the system CMake doesn't now about.
  20. # I chose a bloody new boost, so I need to use the latest RC1 (at the time of writing)
  21. # EDIT: actually we can get rid of this block, Ubuntu 22.04 has a recent enough version already
  22. RUN wget https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1.tar.gz && \
  23. tar -zxf cmake-3.24.1.tar.gz && \
  24. cd cmake-3.24.1 && \
  25. ./bootstrap && \
  26. make -j $(nproc) && \
  27. make install && \
  28. cd .. && \
  29. rm -rf cmake-3.24.1 && \
  30. rm -rf cmake-3.24.1.tar.gz
  31. # Install emscripten deps
  32. RUN sudo apt-get update || true && \
  33. sudo apt-get install -y libsdl2-dev || true && \
  34. (git clone https://github.com/emscripten-core/emsdk.git || true) && \
  35. cd emsdk && \
  36. ./emsdk install latest && \
  37. ./emsdk activate latest && \
  38. sudo cp -prv ./emsdk_env.sh /etc/profile.d/
  39. # Warmup emscripten (this will pre-fetch SDL2, and cache it)
  40. RUN /emsdk/upstream/emscripten/em++ -s WASM=1 -s USE_SDL=2 -s USE_SDL_TTF=2 -O3 /dev/null || true
  41. # Fix some weird linker issue CAF build runs into. (fails to link -lc++abi)
  42. RUN cp -prv /usr/lib/llvm-14/lib/libc++abi.so.1.0 /usr/lib/llvm-14/lib/libc++abi.so
  43. # EDIT: no longer needed!
  44. # RUN cp -prv /usr/lib/llvm-14/lib/libunwind.so.1.0 /usr/lib/llvm-14/lib/libunwind.so
  45. COPY switch-to-latest-clang /usr/local/bin/switch-to-latest-clang
  46. RUN chmod +x /usr/local/bin/switch-to-latest-clang
  47. RUN apt clean
  48. FROM scratch
  49. COPY --from=build1 / /
  50. CMD "/bin/bash"