Skip to content

Commit

Permalink
Update Docker build configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
f0reachARR committed Sep 16, 2024
1 parent a59def8 commit 5f6f274
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 104 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
matrix:
target:
[
"amd64",
"aarch64",
"amd64_small_humble",
"aarch64_small_humble",
"amd64_small_jazzy"
"humble_large",
"humble_large_cross",
"humble_small",
"humble_small_cross",
"jazzy_small",
]
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -53,6 +53,7 @@ jobs:
steps:
- name: Pull latest images
run: |
docker pull ghcr.io/fortefibre/buildroot:humble-amd64
docker pull --platform linux/arm64/v8 ghcr.io/fortefibre/buildroot:humble-aarch64
docker pull ghcr.io/fortefibre/buildroot:humble-large
docker pull ghcr.io/fortefibre/buildroot:jazzy-small
docker pull --platform linux/arm64/v8 ghcr.io/fortefibre/buildroot:humble-large-cross
docker system prune -f
7 changes: 4 additions & 3 deletions buildroot/Dockerfile.arm64 → buildroot/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ROS_DISTRO=humble
ARG BASE_IMAGE
ARG PACKAGE_XML=package.xml

FROM --platform=${BUILDPLATFORM} impactaky/mc-ubuntu22.04-${TARGETARCH}-host:2.3.0 AS mimic-host
FROM $BASE_IMAGE as build_stage
Expand All @@ -11,11 +12,11 @@ RUN --mount=type=cache,target=/var/lib/apt,sharing=private apt-get update && \
apt-get install -y \
python3-vcstool git python3-colcon-common-extensions python3-colcon-mixin python3-rosdep \
python3-bloom python3-pip fakeroot \
debhelper git gpg dh-python reprepro \
&& rosdep init
debhelper git gpg dh-python && \
rosdep init

RUN mkdir -p /tmp/ws/meta
COPY package.xml /tmp/ws/meta/package.xml
COPY ${PACKAGE_XML} /tmp/ws/meta/package.xml
COPY rosdep.yaml /tmp/ws/rosdep.yaml

RUN --mount=type=cache,target=/var/lib/apt,sharing=private \
Expand Down
7 changes: 4 additions & 3 deletions buildroot/Dockerfile.amd64 → buildroot/Dockerfile.native
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ROS_DISTRO=humble
ARG BASE_IMAGE
ARG PACKAGE_XML=package.xml

FROM $BASE_IMAGE as build_stage

Expand All @@ -9,11 +10,11 @@ RUN --mount=type=cache,target=/var/lib/apt,sharing=private apt-get update && \
apt-get install -y \
python3-vcstool git python3-colcon-common-extensions python3-colcon-mixin python3-rosdep \
python3-bloom python3-pip fakeroot \
debhelper git gpg dh-python reprepro \
&& rosdep init
debhelper git gpg dh-python && \
rosdep init

RUN mkdir -p /tmp/ws/meta
COPY package.xml /tmp/ws/meta/package.xml
COPY ${PACKAGE_XML} /tmp/ws/meta/package.xml
COPY rosdep.yaml /tmp/ws/rosdep.yaml

RUN --mount=type=cache,target=/var/lib/apt,sharing=private \
Expand Down
29 changes: 0 additions & 29 deletions buildroot/Dockerfile.small.amd64

This file was deleted.

34 changes: 0 additions & 34 deletions buildroot/Dockerfile.small.arm64

This file was deleted.

74 changes: 46 additions & 28 deletions buildroot/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,65 +1,83 @@
group "default" {
targets = ["amd64", "aarch64", "amd64_small_humble", "aarch64_small_humble",
"amd64_small_jazzy", "aarch64_small_jazzy"]
targets = [
"humble_large",
"humble_large_cross",
"humble_small",
"humble_small_cross",
"jazzy_small"
]
}


target "amd64" {
target "humble_large" {
target = "build_stage"
dockerfile = "Dockerfile.amd64"
platforms = ["linux/amd64"]
tags = ["ghcr.io/fortefibre/buildroot:humble-amd64"]
dockerfile = "Dockerfile.native"
platforms = ["linux/amd64", "linux/arm64"]
tags = [
"ghcr.io/fortefibre/buildroot:humble-large"
]
args = {
BASE_IMAGE = "docker.io/hakuturu583/cuda_ros:humble-cuda-12.2.0-devel"
PACKAGE_XML = "package.xml"
}
}

target "aarch64" {
target "humble_large_cross" {
target = "build_stage"
dockerfile = "Dockerfile.arm64"
dockerfile = "Dockerfile.cross"
platforms = ["linux/arm64"]
tags = ["ghcr.io/fortefibre/buildroot:humble-aarch64"]
tags = [
"ghcr.io/fortefibre/buildroot:humble-large-cross"
]
args = {
BASE_IMAGE = "docker.io/hakuturu583/cuda_ros:lt4-humble-cuda-12.2.2-devel"
PACKAGE_XML = "package.xml"
}
}

target "amd64_small_humble" {
target "humble_small" {
target = "build_stage"
dockerfile = "Dockerfile.small.amd64"
platforms = ["linux/amd64"]
tags = ["ghcr.io/fortefibre/buildroot-small:humble-amd64"]
dockerfile = "Dockerfile.native"
platforms = ["linux/amd64", "linux/arm64"]
tags = [
"ghcr.io/fortefibre/buildroot:humble-small"
]
args = {
ROS_DISTRO = "humble"
BASE_IMAGE = "docker.io/library/ros:humble-ros-perception"
PACKAGE_XML = "package.small.xml"
}
}

target "aarch64_small_humble" {
target "humble_small_cross" {
target = "build_stage"
dockerfile = "Dockerfile.small.arm64"
dockerfile = "Dockerfile.cross"
platforms = ["linux/arm64"]
tags = ["ghcr.io/fortefibre/buildroot-small:humble-aarch64"]
tags = [
"ghcr.io/fortefibre/buildroot:humble-small-cross"
]
args = {
ROS_DISTRO = "humble"
BASE_IMAGE = "docker.io/library/ros:humble-ros-perception"
PACKAGE_XML = "package.small.xml"
}
}

target "amd64_small_jazzy" {
target "jazzy_small" {
target = "build_stage"
dockerfile = "Dockerfile.small.amd64"
platforms = ["linux/amd64"]
tags = ["ghcr.io/fortefibre/buildroot-small:jazzy-amd64"]
dockerfile = "Dockerfile.native"
platforms = ["linux/amd64", "linux/arm64"]
tags = ["ghcr.io/fortefibre/buildroot:jazzy-small"]
args = {
ROS_DISTRO = "jazzy"
BASE_IMAGE = "docker.io/library/ros:jazzy-ros-perception"
PACKAGE_XML = "package.small.xml"
}
}

target "aarch64_small_jazzy" {
target "jazzy_small_cross" {
target = "build_stage"
dockerfile = "Dockerfile.small.arm64"
dockerfile = "Dockerfile.cross"
platforms = ["linux/arm64"]
tags = ["ghcr.io/fortefibre/buildroot-small:jazzy-aarch64"]
tags = ["ghcr.io/fortefibre/buildroot:jazzy-small-aarch64-cross"]
args = {
ROS_DISTRO = "jazzy"
BASE_IMAGE = "docker.io/library/ros:jazzy-ros-perception"
PACKAGE_XML = "package.small.xml"
}
}

0 comments on commit 5f6f274

Please sign in to comment.