-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
120 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Ignore Git repository files | ||
.git | ||
.gitignore | ||
|
||
# Ignore node_modules or other build artifacts | ||
node_modules | ||
build | ||
|
||
# Ignore Docker-related files | ||
Dockerfile* | ||
docker-compose.yml | ||
|
||
# Ignore OS-specific files | ||
.DS_Store | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Use a lightweight base image; Docker-OSX handles the macOS environment | ||
FROM sickcodes/docker-osx:latest | ||
|
||
# Set environment variables | ||
ENV QT_VERSION=6.8.1 | ||
ENV QT_PATH=/opt/Qt | ||
ENV QT_DESKTOP=$QT_PATH/${QT_VERSION}/clang_64 | ||
|
||
ENV PATH=$QT_DESKTOP/bin:/usr/local/bin:$PATH | ||
|
||
# Install Homebrew (if not already installed) | ||
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" \ | ||
&& eval "$(/usr/local/bin/brew shellenv)" \ | ||
&& brew update | ||
|
||
# Install necessary dependencies via Homebrew | ||
RUN brew install cmake ninja git | ||
|
||
# Install Qt using Homebrew | ||
RUN brew install qt@${QT_VERSION} \ | ||
&& brew link --force qt@${QT_VERSION} | ||
|
||
# Set up Qt environment | ||
RUN mkdir -p $QT_PATH \ | ||
&& ln -s /usr/local/opt/qt@${QT_VERSION} $QT_PATH/Qt | ||
|
||
# Configure Git to trust the project directory | ||
RUN git config --global --add safe.directory /project/source | ||
|
||
# Set the working directory | ||
WORKDIR /project/build | ||
|
||
# Define the build command | ||
CMD cmake -S /project/source -B . -G Ninja -DCMAKE_BUILD_TYPE=Release && \ | ||
cmake --build . --target all --config Release && \ | ||
cmake --install . --config Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,68 @@ | ||
# Use the official Ubuntu 22.04 LTS as the base image | ||
FROM ubuntu:22.04 | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Argument Definitions | ||
# ------------------------------------------------------------------------------ | ||
|
||
ARG QT_VERSION=6.8.1 | ||
ARG QT_MODULES="qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors" | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
ENV DISPLAY :99 | ||
# ------------------------------------------------------------------------------ | ||
# Environment Variables | ||
# ------------------------------------------------------------------------------ | ||
|
||
ENV QT_PATH /opt/Qt | ||
ENV QT_DESKTOP $QT_PATH/${QT_VERSION}/gcc_64 | ||
ENV DEBIAN_FRONTEND=noninteractive \ | ||
DISPLAY=:99 \ | ||
QT_PATH=/opt/Qt \ | ||
QT_DESKTOP=${QT_PATH}/${QT_VERSION}/gcc_64 \ | ||
PATH=/usr/lib/ccache:${QT_DESKTOP}/bin:${PATH} \ | ||
LANG=en_US.UTF-8 \ | ||
LANGUAGE=en_US:en \ | ||
LC_ALL=en_US.UTF-8 | ||
|
||
ENV PATH /usr/lib/ccache:$QT_DESKTOP/bin:$PATH | ||
# ------------------------------------------------------------------------------ | ||
# Install Dependencies and Qt | ||
# ------------------------------------------------------------------------------ | ||
|
||
# Update and install essential packages | ||
COPY tools/setup/install-dependencies-debian.sh /tmp/qt/ | ||
RUN /tmp/qt/install-dependencies-debian.sh | ||
RUN chmod +x /tmp/qt/install-dependencies-debian.sh && \ | ||
/tmp/qt/install-dependencies-debian.sh && \ | ||
rm /tmp/qt/install-dependencies-debian.sh | ||
|
||
# Install Qt | ||
COPY tools/setup/install-qt-debian.sh /tmp/qt/ | ||
RUN /tmp/qt/install-qt-debian.sh | ||
RUN chmod +x /tmp/qt/install-qt-debian.sh && \ | ||
/tmp/qt/install-qt-debian.sh && \ | ||
rm /tmp/qt/install-qt-debian.sh | ||
|
||
# Generate and set locale | ||
RUN locale-gen en_US.UTF-8 && dpkg-reconfigure locales | ||
|
||
# Configure Git to recognize the project directory as safe | ||
RUN git config --global --add safe.directory /project/source | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Add Non-Root User (Optional but Recommended) | ||
# ------------------------------------------------------------------------------ | ||
|
||
# Uncomment the following lines to add a non-root user | ||
# RUN useradd -m builder | ||
# USER builder | ||
# WORKDIR /home/builder/project/build | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Set Working Directory | ||
# ------------------------------------------------------------------------------ | ||
|
||
WORKDIR /project/build | ||
CMD cmake -S /project/source -B . -G Ninja -DCMAKE_BUILD_TYPE=Release ; \ | ||
cmake --build . --target all --config Release ; \ | ||
cmake --install . --config Release | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Build Commands | ||
# ------------------------------------------------------------------------------ | ||
|
||
CMD set -ex && \ | ||
cmake -S /project/source -B . -G Ninja -DCMAKE_BUILD_TYPE=Release && \ | ||
cmake --build . --target all --config Release && \ | ||
cmake --install . --config Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Exit immediately if a command exits with a non-zero status | ||
set -e | ||
|
||
# Build the macOS Docker-OSX image | ||
docker build --file ./deploy/docker/Dockerfile-build-macos -t qgc-macos-docker . | ||
|
||
# Run the Docker-OSX container with necessary volume mounts | ||
docker run --rm \ | ||
--cap-add SYS_ADMIN \ | ||
--device /dev/fuse \ | ||
--security-opt apparmor:unconfined \ | ||
-v "${PWD}:/project/source" \ | ||
-v "${PWD}/build:/project/build" \ | ||
qgc-macos-docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters