Commit 85ca8584 authored by Nikunj Arora's avatar Nikunj Arora
Browse files

Added Dockerfile and build script

parent 3888dc6d
FROM ubuntu:latest
ARG DEBIAN_FRONTEND=noninteractive
# Enable "deb-src" in sources.list
RUN sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list &&\
apt update
# Install CMake from source
RUN apt install -y build-essential libssl-dev wget curl &&\
cd /tmp &&\
wget &&\
tar -xzvf cmake-3.22.3.tar.gz &&\
cd cmake-3.22.3 &&\
./bootstrap &&\
make &&\
make install &&\
cd / &&\
rm -rf /tmp/*
# Install nodejs
RUN curl -fsSL | bash - &&\
apt update &&\
apt install -y nodejs
# Install other dependencies
RUN apt install -y \
git \
ninja-build \
perl \
python2 \
python3 \
bison \
flex \
gperf \
libgl-dev \
COPY /home
CMD ["./home/"]
# Mount installation directory to /mnt/qt
if [ -d "/mnt/qt" ]; then
cd /mnt/qt
git clone git:// qt-src
cd qt-src
perl init-repository --module-subset=${REPOS} # Eg. REPOS=qtbase,qtmultimedia,qttools
cd ..
mkdir qt-build && cd qt-build
../qt-src/configure -prefix ../qt-build-install
cmake --install .
# Set BUILD_ANDROID if building for android
if [[ -z "${BUILD_ANDROID}" ]]; then
echo "Build Complete"
exit 0
# Mount android sdk to /mnt/android-sdk and android ndk to /mnt/android-ndk
if [ ! -d "/mnt/android-sdk"] || [! -d "/mnt/android-ndk" ]; then
echo "Android SDK/NDK not found"
exit 1
# Set ANDROID_ABI like this: ANDROID_ABI=armeabi-v7a;arm64-v8a;x86;x86_64
export IFS=";"
for abi in ${ANDROID_ABI}; do
echo "Building Android for ABI ${abi}"
cd ..
mkdir qt-build-android-${abi} && cd qt-build-android-${abi}
../qt-src/configure -xplatform android-clang -android-abis ${abi} -qt-host-path ../qt-build-install -android-ndk /mnt/android-ndk/ -android-sdk /mnt/android-sdk -prefix ../qt-build-android-install-${abi}
cmake --install .
# Set BUILD_QAA if building QAA
if [[ -z "${BUILD_QAA}" ]]; then
echo "Build Complete"
exit 0
# Mount ssh keys folder (~/.ssh) to /mnt/ssh
if [ ! -d "/mnt/ssh"]; then
echo "SSH keys not found"
exit 1
# Set GERRIT_USER for gerrit username
cd ..
eval $(ssh-agent -s)
ssh-add /mnt/ssh/id_rsa
mkdir /root/.ssh
ssh-keyscan -t rsa >> /root/.ssh/known_hosts
git clone "ssh://${GERRIT_USER}"
cd qtinterfaceframework
git submodule init && git submodule update
cd ..
./qt-build-install/bin/qt-cmake -GNinja -S qtinterfaceframework -B qtinterfaceframework-build/
cd qtinterfaceframework-build
cmake --build . && cmake --install .
cd ..
for abi in ${ANDROID_ABI}; do
./qt-build-android-install-${abi}/bin/qt-cmake -GNinja -DANDROID_NDK_ROOT=/mnt/android-ndk -DANDROID_SDK_ROOT=/mnt/android-sdk -S qtinterfaceframework -B qtinterfaceframework-build-android-${abi}/
cd qtinterfaceframework-build-android-${abi}
cmake --build . && cmake --install .
for abi in ${ANDROID_ABI}; do
qt-build-android-install-${abi}/bin/qt-cmake -GNinja -DANDROID_NDK_ROOT=/mnt/android-ndk -DANDROID_SDK_ROOT=/mnt/android-sdk -S tqtc-android-automotive -B tqtc-android-automotive_cmake-build-${abi}/
cd tqtc-android-automotive_cmake-build-${abi}
cmake --build . && cmake --install .
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment