| 1 |
# |
| 2 |
# This file is part of KDDockWidgets. |
| 3 |
# |
| 4 |
# SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]> |
| 5 |
# Author: Sérgio Martins <[email protected]> |
| 6 |
# |
| 7 |
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only |
| 8 |
# |
| 9 |
# Contact KDAB at <[email protected]> for commercial licensing options. |
| 10 |
|
| 11 |
# Docker container used by self-hosted runner |
| 12 |
|
| 13 |
# docker build --build-arg GITHUB_RUNNER_TOKEN=<TOKEN> -t kddw_gh_runner . |
| 14 |
# docker build --build-arg GITHUB_RUNNER_TOKEN=<TOKEN2> -t kddw_gh_runner2 . |
| 15 |
# docker run -it kddw_gh_runner /home/ubuntu/actions-runner/run.sh |
| 16 |
|
| 17 |
FROM ubuntu:24.04 |
| 18 |
MAINTAINER Sergio Martins ([email protected]) |
| 19 |
|
| 20 |
ARG GITHUB_RUNNER_TOKEN |
| 21 |
|
| 22 |
ENV TZ=Europe/Berlin |
| 23 |
ENV LC_CTYPE=C.UTF-8 |
| 24 |
ENV PATH=/home/ubuntu/.local/bin:$PATH |
| 25 |
|
| 26 |
ENV IS_SELFHOSTED=1 |
| 27 |
ENV CTEST_PARALLEL_LEVEL=12 |
| 28 |
|
| 29 |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone |
| 30 |
|
| 31 |
RUN apt update -qq && apt install build-essential software-properties-common lld git cmake ninja-build vim curl wget gdebi-core libdbus-glib-1-2 \ |
| 32 |
mesa-common-dev libglu1-mesa-dev libglib2.0-dev libfontconfig \ |
| 33 |
libxkbcommon-dev mesa-utils libgl1-mesa-dev libglu1-mesa-dev \ |
| 34 |
libxkbcommon-x11-0 libssl-dev openssl unzip clang clang-tidy libgtk-3-dev \ |
| 35 |
time xvfb python3-pip jq sudo libxml2-dev libxslt-dev \ |
| 36 |
libx11-xcb1 \ |
| 37 |
libxcb-glx0 \ |
| 38 |
libxcb-keysyms1 \ |
| 39 |
libxcb-image0 \ |
| 40 |
libxcb-shm0 \ |
| 41 |
libxcb-icccm4 \ |
| 42 |
libxcb-sync1 \ |
| 43 |
libxcb-xfixes0 \ |
| 44 |
libxcb-shape0 \ |
| 45 |
libxcb-render-util0 \ |
| 46 |
spdlog-dev \ |
| 47 |
mold \ |
| 48 |
-y |
| 49 |
|
| 50 |
RUN ln -s /usr/bin/python3 /usr/bin/python |
| 51 |
RUN rm /usr/lib/python3.12/EXTERNALLY-MANAGED |
| 52 |
|
| 53 |
# Install GitHub command-line interface (gh) |
| 54 |
# Instructions copied from https://github.com/cli/cli/blob/trunk/docs/install_linux.md |
| 55 |
RUN mkdir -p -m 755 /etc/apt/keyrings \ |
| 56 |
&& curl -s https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ |
| 57 |
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ |
| 58 |
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ |
| 59 |
&& apt-get update \ |
| 60 |
&& apt-get install gh -y \ |
| 61 |
&& apt-get clean \ |
| 62 |
&& rm -rf /var/lib/apt/lists/* |
| 63 |
|
| 64 |
RUN usermod -aG sudo ubuntu |
| 65 |
RUN echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/ubuntu |
| 66 |
RUN chmod 0440 /etc/sudoers.d/ubuntu |
| 67 |
|
| 68 |
|
| 69 |
# Install Qt |
| 70 |
|
| 71 |
RUN pip install --no-cache-dir aqtinstall |
| 72 |
RUN aqt install-qt linux desktop 6.6.0 gcc_64 --outputdir /opt/qt |
| 73 |
RUN aqt install-qt linux desktop 5.15.2 gcc_64 --outputdir /opt/qt |
| 74 |
ENV PATH=/opt/qt/5.15.2/gcc_64/bin/:/opt/qt/6.6.0/gcc_64/bin/:$PATH |
| 75 |
|
| 76 |
# shiboken needs it for icu libs |
| 77 |
ENV LD_LIBRARY_PATH=/opt/qt/6.6.0/gcc_64/lib/:$LD_LIBRARY_PATH |
| 78 |
|
| 79 |
USER ubuntu |
| 80 |
WORKDIR /home/ubuntu |
| 81 |
|
| 82 |
|
| 83 |
# Install GitHub Actions runner |
| 84 |
RUN mkdir actions-runner && cd actions-runner && \ |
| 85 |
curl -o actions-runner-linux-x64-2.321.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.321.0/actions-runner-linux-x64-2.321.0.tar.gz && \ |
| 86 |
echo "ba46ba7ce3a4d7236b16fbe44419fb453bc08f866b24f04d549ec89f1722a29e actions-runner-linux-x64-2.321.0.tar.gz" | shasum -a 256 -c && \ |
| 87 |
tar xzf ./actions-runner-linux-x64-2.321.0.tar.gz && ./config.sh --labels ubuntu-latest,ubuntu-24.04 --url https://github.com/KDAB/KDDockWidgets --token $GITHUB_RUNNER_TOKEN |