From 571be42d8d7f8ce3fb3afc6ba6757f5d930aa4d8 Mon Sep 17 00:00:00 2001 From: 0xc60f <0xc60f@duck.com> Date: Sun, 5 Oct 2025 15:14:24 -0700 Subject: [PATCH 1/3] Added support for arm systems (Apple Silicon) --- .github/workflows/docker-build.yaml | 2 +- Dockerfile | 8 +++++++- docker-compose.yml | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index 4647099..ec45f5f 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -12,7 +12,7 @@ jobs: docker compose build --no-cache - name: start and exec into container run: | # ensure a clean build tree inside container, then build - docker compose run --rm -T rover bash -lc 'rm -rf build install log && colcon build --symlink-install --packages-up-to arm_control' + docker compose run --platform linux/amd64 --rm -T rover bash -lc 'rm -rf build install log && colcon build --symlink-install --packages-up-to arm_control' - name: Cleanup if: always() run: | diff --git a/Dockerfile b/Dockerfile index 9fe47d6..aaef99d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,13 @@ # if you have anymore questions ask Aaron # official base image in docs -FROM osrf/ros:humble-desktop +FROM --platform=$TARGETPLATFORM osrf/ros:humble-desktop + +ARG TARGETPLATFORM +ARG BUILDPLATFORM + +# Debugging info (optional) +RUN echo "Building for $TARGETPLATFORM on $BUILDPLATFORM" # consistency with setup files ENV DEBIAN_FRONTEND=noninteractive diff --git a/docker-compose.yml b/docker-compose.yml index f3029ff..2813e24 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,6 +17,9 @@ services: build: context: . dockerfile: Dockerfile + platforms: + - linux/amd64 + - linux/arm64 image: roverflake2:dev container_name: rover_dev working_dir: /RoverFlake2 From 0eb9c65de114b3783eb4d93a2ca32671dda52b99 Mon Sep 17 00:00:00 2001 From: 0xc60f <0xc60f@duck.com> Date: Sun, 26 Oct 2025 16:52:31 -0700 Subject: [PATCH 2/3] Changed to buildx again --- .github/workflows/docker-build.yaml | 26 ++++++++++++++++++-------- docker-compose.yml | 6 +++--- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index ec45f5f..5289380 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -5,18 +5,28 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - with: # added this, might fix a bug that's taken over 3 hours to find + with: submodules: recursive - - name: build + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + driver: docker-container + install: true + + - name: Build multi-arch image run: | - docker compose build --no-cache - - name: start and exec into container - run: | # ensure a clean build tree inside container, then build - docker compose run --platform linux/amd64 --rm -T rover bash -lc 'rm -rf build install log && colcon build --symlink-install --packages-up-to arm_control' + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --tag roverflake2:dev \ + --file Dockerfile \ + --load . + - name: Start and exec into container + run: | + docker compose run --rm -T rover bash -lc \ + 'rm -rf build install log && colcon build --symlink-install --packages-up-to arm_control' - name: Cleanup if: always() - run: | - docker compose down --remove-orphans || true + run: docker compose down --remove-orphans || true - name: Notify Discord (success) if: ${{ success() }} uses: appleboy/discord-action@v1.0.0 diff --git a/docker-compose.yml b/docker-compose.yml index 2813e24..53460b4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,9 +17,9 @@ services: build: context: . dockerfile: Dockerfile - platforms: - - linux/amd64 - - linux/arm64 + #platforms: + #- linux/amd64 + #- linux/arm64 image: roverflake2:dev container_name: rover_dev working_dir: /RoverFlake2 From 469be925f30d6e00208114d68910ccb2ece1a1b8 Mon Sep 17 00:00:00 2001 From: 0xc60f <0xc60f@duck.com> Date: Sun, 26 Oct 2025 16:59:07 -0700 Subject: [PATCH 3/3] Added containered snapshots --- .github/workflows/docker-build.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index 5289380..9142af9 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -7,6 +7,16 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + - name: Set up Docker + uses: docker/setup-docker-action@v4 + with: + daemon-config: | + { + "debug": true, + "features": { + "containerd-snapshotter": true + } + } - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 with: @@ -19,6 +29,7 @@ jobs: --platform linux/amd64,linux/arm64 \ --tag roverflake2:dev \ --file Dockerfile \ + --push \ --load . - name: Start and exec into container run: |