-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
135 lines (120 loc) · 2.92 KB
/
Dockerfile
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
FROM ubuntu:22.04
ENV TZ=America/Sao_Paulo
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ARG USER
ARG UID
ARG GID
# The Qt version to build
ARG QT_VERSION=6.5.3
ARG RPI_IMAGE=2024-07-04-raspios-bookworm-arm64-lite.img.xz
ARG PARALLELIZATION=12
ENV DEBIAN_FRONTEND=noninteractive
#############################
# Prepare and update Ubuntu #
#############################
RUN apt update
#############################
# Install required packages #
#############################
# Qt
RUN apt install -y \
sudo \
locales \
perl \
make \
cmake \
build-essential \
libclang-dev \
ninja-build \
gcc \
git \
bison \
python3 \
gperf \
pkg-config \
libfontconfig1-dev \
libfreetype6-dev \
libx11-dev \
libx11-xcb-dev \
libxext-dev \
libxfixes-dev \
libxi-dev \
libxrender-dev \
libxcb1-dev \
libxcb-glx0-dev \
libxcb-keysyms1-dev \
libxcb-image0-dev \
libxcb-shm0-dev \
libxcb-icccm4-dev \
libxcb-sync-dev \
libxcb-xfixes0-dev \
libxcb-shape0-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxcb-util-dev \
libxcb-xinerama0-dev \
libxcb-xkb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libatspi2.0-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
freeglut3-dev \
# cross-compiler toolchain \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
# package for building CMake \
libssl-dev \
# data transfer \
rsync \
wget \
# for chroot \
qemu-user-static \
parted \
udev
RUN apt-get clean --yes && rm -rf /var/lib/apt/lists/*
# Generate and set the locale
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
RUN dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8
RUN useradd -m ${USER} --uid=${UID} && echo "${USER}:${USER}" | chpasswd && adduser ${USER} sudo
RUN echo "Set disable_coredump false" >> /etc/sudo.conf
RUN echo "sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER ${UID}:${GID}
# WORKDIR /home/${USER}/qt-build
# # Create Qt directories
# RUN mkdir qt-raspi qt-host qt-pibuild qt-hostbuild
WORKDIR /home/${USER}
# Clone Qt6 source
RUN git clone -b ${QT_VERSION} "https://codereview.qt-project.org/qt/qt5" qt6
WORKDIR /home/${USER}/qt6
RUN git submodule update --init \
qtbase \
qtdeclarative \
qtsvg \
qtimageformats \
qtmultimedia \
qtwebsockets \
qtserialport \
qtcharts \
qtconnectivity \
qtnetworkauth \
qtmqtt \
qthttpserver \
qtcharts \
qtshadertools
WORKDIR /home/${USER}
# Download Raspbian OS Lite 64Bit
RUN echo "Download RPi image: ${RPI_IMAGE}"
RUN wget -O ${RPI_IMAGE} https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/${RPI_IMAGE}
RUN echo "Extracting image ${RPI_IMAGE}"
RUN xz -d ${RPI_IMAGE}
COPY rpi-toolchain.cmake /home/${USER}/rpi-toolchain.cmake
COPY --chown=${UID}:${GID} qt-build.sh /home/${USER}/qt-build.sh
RUN chmod +x /home/${USER}/qt-build.sh
WORKDIR /home/${USER}
# Run the shell script
CMD ["./qt-build.sh"]