-
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
7 changed files
with
115 additions
and
18 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Run this from root directory | ||
|
||
# Exit immediately if a command exits with a non-zero status | ||
set -e | ||
|
||
docker build --file ./deploy/docker/Dockerfile-build-ubuntu -t qgc-ubuntu-docker . | ||
docker run --cap-add SYS_ADMIN --device /dev/fuse --security-opt apparmor:unconfined --rm -v ${PWD}:/project/source -v ${PWD}/build:/project/build qgc-ubuntu-docker | ||
# Define variables for better maintainability | ||
DOCKERFILE_PATH="./deploy/docker/Dockerfile-build-ubuntu" | ||
IMAGE_NAME="qgc-ubuntu-docker" | ||
SOURCE_DIR="$(pwd)" | ||
BUILD_DIR="${SOURCE_DIR}/build" | ||
|
||
# Build the Docker image | ||
docker build --file "${DOCKERFILE_PATH}" -t "${IMAGE_NAME}" "${SOURCE_DIR}" | ||
|
||
# Run the Docker container with necessary permissions and volume mounts | ||
docker run \ | ||
--rm \ | ||
--cap-add SYS_ADMIN \ | ||
--device /dev/fuse \ | ||
--security-opt apparmor:unconfined \ | ||
-v "${SOURCE_DIR}:/project/source" \ | ||
-v "${BUILD_DIR}:/project/build" \ | ||
"${IMAGE_NAME}" |