Selaa lähdekoodia

Create Ubuntu 22.04 build container

master
Ray Burgemeestre 2 vuotta sitten
vanhempi
commit
49ca1f3388
3 muutettua tiedostoa jossa 74 lisäystä ja 5 poistoa
  1. +60
    -0
      Dockerfile-ubuntu2204
  2. +9
    -0
      Makefile
  3. +5
    -5
      switch-to-latest-clang

+ 60
- 0
Dockerfile-ubuntu2204 Näytä tiedosto

@@ -0,0 +1,60 @@
FROM ubuntu:22.04 AS build1

MAINTAINER Ray Burgemeestre

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get -y install g++ 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-14 clang-tidy-14 libclang-14-dev clangd-14 lldb-14 lld-14 clangd-14 && \
apt-get install -y libc++-14-dev libc++-14-dev clang-format-14 && \
\
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

# Install emscripten deps
RUN sudo apt-get update && \
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-14/lib/libc++abi.so.1.0 /usr/lib/llvm-14/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

COPY switch-to-latest-clang /usr/local/bin/switch-to-latest-clang

RUN chmod +x /usr/local/bin/switch-to-latest-clang

RUN apt clean

FROM scratch

COPY --from=build1 / /

CMD "/bin/bash"

+ 9
- 0
Makefile Näytä tiedosto

@@ -17,6 +17,15 @@ ubuntu2004nocache:
ubuntu2004publish:
docker push rayburgemeestre/build-ubuntu:20.04

ubuntu2204:
docker build . -f Dockerfile-ubuntu2204 -t rayburgemeestre/build-ubuntu:22.04

ubuntu2204nocache:
docker build . -f Dockerfile-ubuntu2204 -t rayburgemeestre/build-ubuntu:22.04 --no-cache

ubuntu2204publish:
docker push rayburgemeestre/build-ubuntu:22.04

shell:
docker run -it -v $$PWD:$$PWD --workdir $$PWD rayburgemeestre/build-ubuntu:18.04 /bin/bash


+ 5
- 5
switch-to-latest-clang Näytä tiedosto

@@ -3,10 +3,10 @@
set +e
set -o pipefail

update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-12 40 > /tmp/.switch-to-clang.stdout
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-12 40 >> /tmp/.switch-to-clang.stdout
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 40 >> /tmp/.switch-to-clang.stdout
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 40 >> /tmp/.switch-to-clang.stdout
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-12 40 >> /tmp/.switch-to-clang.stdout
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-14 40 > /tmp/.switch-to-clang.stdout
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-14 40 >> /tmp/.switch-to-clang.stdout
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-14 40 >> /tmp/.switch-to-clang.stdout
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 40 >> /tmp/.switch-to-clang.stdout
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-14 40 >> /tmp/.switch-to-clang.stdout

echo compiler set to: $(readlink /etc/alternatives/c++)

Loading…
Peruuta
Tallenna