-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_debian_clang-19
94 lines (68 loc) · 3.99 KB
/
Dockerfile_debian_clang-19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
FROM debian:latest
USER root
RUN passwd --delete root
# INSTALL CLANG
RUN apt update -y
RUN apt install lsb-release ninja-build wget make build-essential software-properties-common gnupg git sudo nano valgrind -y
RUN wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh
RUN chmod +x /tmp/llvm.sh
RUN /tmp/llvm.sh 19 all
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100
RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-19 100
RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-19 100
# INSTALL ADDITIONAL PKGS
# for vcpkg
RUN apt install curl zip unzip tar libtool autoconf automake autoconf-archive bison flex nasm -y
# for Qt6
RUN apt install pkg-config libgl-dev libgl1-mesa-dev xkb-data libxcb-util-dev libxcb-util0-dev \
libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxaw7-dev libxcomposite-dev libxcursor-dev \
libxdamage-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev \
libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxxf86vm-dev \
libxcb-glx0-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev \
libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev \
libxcb-dri3-dev uuid-dev libxcb-cursor-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-present-dev libxcb-composite0-dev \
libxcb-ewmh-dev libxcb-res0-dev -y
# ugly workaround because of https://github.com/microsoft/vcpkg/issues/32377
RUN apt install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1-mesa-dev -y # didn't help
RUN apt install *xkb* -y # works
# for OpenCV
RUN apt install libva-dev libvdpau-dev -y
# for gstreamer
RUN apt install libdrm-dev -y
# INSTALL CPPTOOLS
RUN apt install python3 python3-venv -y
# CREATE USER
RUN groupadd build
RUN useradd -rm -d /home/build -s /bin/bash -g root -G sudo -u 1001 build
RUN echo "export USER=build" > /etc/profile.d/set_user.sh
RUN passwd --delete build
RUN usermod -a -G sudo build
RUN usermod -a -G build build
RUN mkdir -p "/home/build/cppproject"
RUN chown build:build "/home/build/cppproject"
RUN mkdir -p "/home/build/.conan2"
RUN chown build:build "/home/build/.conan2"
RUN ln -s "/home/build/.conan2" "/home/build/conan2"
RUN mkdir -p "/home/build/.vcpkg"
RUN chown build:build "/home/build/.vcpkg"
RUN ln -s "/home/build/.vcpkg" "/home/build/vcpkg"
USER build:build
WORKDIR /home/build
# INSTALL BUILD SYSTEM
RUN python3 -m venv /home/build/.local --system-site-packages
ENV PATH="${PATH}:/home/build/.local/bin"
RUN /home/build/.local/bin/pip install cmake
RUN /home/build/.local/bin/pip install conan
RUN /home/build/.local/bin/conan remote update conancenter --url="https://center2.conan.io"
RUN /home/build/.local/bin/pip install gprof2dot matplotlib pillow
ENV VCPKG_VERSION="2024.11.16"
RUN echo '#!/bin/bash' > "/home/build/.install_vcpkg.sh"
RUN echo 'if [ -d "/home/build/vcpkg/vcpkg" ]; then exit 0; fi' >> "/home/build/.install_vcpkg.sh"
RUN echo 'wget "https://github.com/microsoft/vcpkg/archive/refs/tags/${VCPKG_VERSION}.zip" -O "/tmp/vcpkg-${VCPKG_VERSION}.zip"' >> "/home/build/.install_vcpkg.sh"
RUN echo 'unzip "/tmp/vcpkg-${VCPKG_VERSION}.zip" -d "/home/build/.vcpkg"' >> "/home/build/.install_vcpkg.sh"
RUN echo 'mv "/home/build/.vcpkg/vcpkg-${VCPKG_VERSION}" "/home/build/.vcpkg/vcpkg"' >> "/home/build/.install_vcpkg.sh"
RUN echo '"/home/build/.vcpkg/vcpkg/bootstrap-vcpkg.sh"' >> "/home/build/.install_vcpkg.sh"
RUN chmod +x "/home/build/.install_vcpkg.sh"
RUN echo 'export VCPKG_ROOT="/home/build/.vcpkg/vcpkg"' >> "/home/build/.bashrc"
RUN echo 'export PATH="${PATH}:/home/build/.local/bin:${VCPKG_ROOT}"' >> "/home/build/.bashrc"