feature/setup_development_environment #2

Merged
silklaasboer merged 8 commits from feature/setup_development_environment into main 2025-05-28 14:47:41 +00:00
4 changed files with 150 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
name: Build and Push Docker Image
on:
push:
branches:
- 'main'
paths:
- '**/Dockerfile'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into Gitea Container Registry
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login ${{ secrets.LOCAL_INSTANCE_IP }} -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build Docker image
run: |
docker build -t ${{ secrets.LOCAL_INSTANCE_IP }}/${{ secrets.DOCKER_USERNAME }}/devcontainer:latest -f Dockerfile .
- name: Push Docker image
run: |
docker push ${{ secrets.LOCAL_INSTANCE_IP }}/${{ secrets.DOCKER_USERNAME }}/devcontainer:latest

View File

@@ -0,0 +1,18 @@
# .gitea/workflows/build.yml
name: Build Validation
on:
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Docker Image
run: |
docker build -t ${{ secrets.LOCAL_INSTANCE_IP }}/${{ secrets.DOCKER_USERNAME }}/devcontainer:latest -f Dockerfile .

103
Dockerfile Normal file
View File

@@ -0,0 +1,103 @@
# Use the official Alpine Linux image
FROM alpine:3.21
# Install dependencies for Android SDK and Qt build tools
RUN apk update && \
apk add --no-cache \
bash \
build-base \
cmake \
git \
curl \
unzip \
openjdk17 \
libx11 \
libxcomposite \
libxrandr \
libxcursor \
libxi \
libx11 \
libx11-dev \
libxcb \
libxcb-dev \
libxkbcommon \
libxkbcommon-dev \
xcb-util-dev \
xcb-util-image-dev \
xcb-util-keysyms-dev \
xcb-util-renderutil-dev \
xcb-util-wm-dev \
xcb-util-cursor-dev \
mesa-dev \
freetype-dev \
fontconfig-dev \
dbus-dev \
libusb
ENV QT_VERSION=6.8.0
ENV QT_INSTALL_PATH=/opt/qt-${QT_VERSION}
# Download and install Qt 6.8.0 from the official Qt website
RUN mkdir -p ${QT_INSTALL_PATH} && \
cd ${QT_INSTALL_PATH} && \
wget https://download.qt.io/archive/qt/6.8/6.8.0/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \
tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \
rm qt-everywhere-src-${QT_VERSION}.tar.xz && \
cd qt-everywhere-src-${QT_VERSION} && \
./configure -prefix ${QT_INSTALL_PATH} \
-nomake examples \
-nomake tests \
-nomake benchmarks \
-optimized-qmake \
-commercial -confirm-license \
-skip qt3d \
-skip qtdatavis3d \
-skip qtgamepad \
-skip qtlottie \
-skip qtnetworkauth \
-skip qtquicktimeline \
-skip qtsensors \
-skip qtspeech \
-skip qtwebchannel \
-skip qtwebengine \
-skip qtwebglplugin \
-release \
-optimize-size && \
make -j$(nproc) && \
make install && \
rm -rf ${QT_INSTALL_PATH}/qt-everywhere-src-${QT_VERSION}
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV PATH="${QT_INSTALL_PATH}/bin:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/emulator:${ANDROID_SDK_ROOT}/tools:${ANDROID_SDK_ROOT}/tools/bin:${JAVA_HOME}/bin:$PATH"
# Install Android SDK Command Line Tools
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \
curl -o sdk-tools-linux.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip && \
unzip sdk-tools-linux.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools && \
rm sdk-tools-linux.zip && \
mv ${ANDROID_SDK_ROOT}/cmdline-tools/cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/latest
# Install required Android SDK components
RUN yes | sdkmanager --licenses && \
sdkmanager --update && \
sdkmanager "platform-tools" "platforms;android-33" "build-tools;33.0.2"
# Verify SDK installation
RUN sdkmanager --list
# Set working directory
WORKDIR /workspace
# Set environment variables for Qt and Android SDK
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk
ENV QT_QPA_PLATFORM=xcb
ENV QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/qt6/plugins/platforms
ENV LD_LIBRARY_PATH=/opt/qt-6.8.0
ENV QT_DEBUG_PLUGINS=1
# Expose ADB debugging port
EXPOSE 5555
# Start bash as the default command
CMD ["/bin/bash"]

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2025 silklaasboer
Copyright (c) 2025 silklaasboer & pavankumar bellary
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: