Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
91 lines (80 loc) · 3.34 KB
/
Copy pathDockerfile
File metadata and controls
91 lines (80 loc) · 3.34 KB
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
# Pinned so the toolchain doesn't change underneath the build. Newer images ship
# CMake 4, which rejects the cmake_minimum_required(VERSION 2.8.x) in botui,
# libkar, and pcompiler. Ubuntu 24.04 provides CMake 3.28 and Qt 6.4.
FROM ubuntu:24.04 AS botui-base
ENV TZ=America/Chicago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
apt-get install -y \
build-essential \
ca-certificates \
cmake \
git \
imagemagick \
libssl-dev \
libx11-dev \
qt6-base-dev \
qt6-base-dev-tools \
qt6-declarative-dev \
xdotool \
xvfb \
zlib1g-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# The KIPR libraries botui links against, at the versions wombat-os ships.
# libwallaby's camera module downloads and builds OpenCV and libav, so its
# layer takes a while the first time. Each ref sits above its own layer so
# changing one doesn't rebuild the others.
ARG LIBKAR_REF=v1.0.0
RUN git clone --depth 1 --branch $LIBKAR_REF https://github.com/kipr/libkar.git /tmp/libkar && \
cmake -S /tmp/libkar -B /tmp/libkar/build && \
cmake --build /tmp/libkar/build -j "$(nproc)" && \
cmake --install /tmp/libkar/build && \
rm -rf /tmp/libkar
ARG PCOMPILER_REF=v1.0.0
RUN git clone --depth 1 --branch $PCOMPILER_REF https://github.com/kipr/pcompiler.git /tmp/pcompiler && \
cmake -S /tmp/pcompiler -B /tmp/pcompiler/build && \
cmake --build /tmp/pcompiler/build -j "$(nproc)" && \
cmake --install /tmp/pcompiler/build && \
rm -rf /tmp/pcompiler
# libwallaby's tests stay on: with_tests=OFF fails to configure at v1.2.1.
# Its bundled libav has x86 inline assembly that current binutils rejects, so
# libav is built without assembly; nothing here depends on its speed.
ARG LIBWALLABY_REF=v1.2.1
RUN git clone --depth 1 --branch $LIBWALLABY_REF https://github.com/kipr/libwallaby.git /tmp/libwallaby && \
sed -i 's/--disable-filters/--disable-filters --disable-asm/' \
/tmp/libwallaby/module/camera/dependencies/libav/CMakeLists.txt && \
grep -q -- --disable-asm /tmp/libwallaby/module/camera/dependencies/libav/CMakeLists.txt && \
cmake -S /tmp/libwallaby -B /tmp/libwallaby/build \
-Dwith_python_binding=OFF \
-Dwith_xml_binding=OFF \
-Dwith_documentation=OFF && \
cmake --build /tmp/libwallaby/build -j "$(nproc)" && \
cmake --install /tmp/libwallaby/build && \
ldconfig && \
rm -rf /tmp/libwallaby
# A stub of wombat-os's network mode file. MODE 2 (Wi-Fi off) stops botui
# from trying to start the access point, which it does when the file is
# missing. Writable by any user because the build runs as uid 1000 and Dev
# Containers can remap the ubuntu account to the Linux host's uid/gid.
RUN mkdir -p /home/kipr/wombat-os/configFiles /home/kipr/Documents/KISS && \
printf 'MODE 2\nEVENT_MODE false\n' > /home/kipr/wombat-os/configFiles/wifiConnectionMode.txt && \
chmod -R a+rwX /home/kipr
WORKDIR /home/dev/botui
CMD ["bash", "build.sh"]
FROM botui-base AS devcontainer
RUN apt-get update \
&& apt-get install -y \
curl \
fd-find \
file \
fish \
fzf \
gdb \
gnupg \
ripgrep \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Final stage is default, so compose-based build is unaffected
FROM botui-base AS botui