Skip to content

Commit

Permalink
Update docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
f0reachARR committed Feb 19, 2024
1 parent db09a5d commit 4045d2e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 16 deletions.
7 changes: 6 additions & 1 deletion buildroot/Dockerfile.amd64
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ RUN --mount=type=cache,target=/var/lib/apt,sharing=private \
&& rosdep install --from-paths /tmp/ws --ignore-src --rosdistro ${ROS_DISTRO} -y \
&& rm /etc/ros/rosdep/sources.list.d/61-customized-rosdep.list

ENTRYPOINT [ "/bin/bash" ]
ENV ROS_DISTRO=${ROS_DISTRO}

COPY scripts/ /scripts/
RUN chmod +x /scripts/entrypoint.bash

ENTRYPOINT [ "/scripts/entrypoint.bash" ]
7 changes: 6 additions & 1 deletion buildroot/Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ RUN --mount=type=cache,target=/var/lib/apt,sharing=private \
COPY --from=mimic-host / /mimic-cross
RUN /mimic-cross/mimic-cross.deno/setup.sh

ENTRYPOINT [ "/bin/bash" ]
ENV ROS_DISTRO=${ROS_DISTRO}

COPY scripts/ /scripts/
RUN chmod +x /scripts/entrypoint.bash

ENTRYPOINT [ "/scripts/entrypoint.bash" ]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e
source /opt/ros/${ROS_DISTRO}/setup.bash

WORKSPACE_ROOT=$PWD
EXPORT_DIR=${1:-/debs}
EXPORT_DIR=${INPUT_OUT_DIR:-./debs}

mkdir -p $EXPORT_DIR

Expand Down Expand Up @@ -47,4 +47,4 @@ for PKG_REL_PATH in $(colcon --log-base /dev/null list -t -p); do
popd
done

chown -R $ORIG_UID:$ORIG_GID $EXPORT_DIR
chmod -R a+w $EXPORT_DIR
19 changes: 19 additions & 0 deletions buildroot/scripts/entrypoint.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e

if [ -z "$ROS_DISTRO" ]; then
echo "ROS_DISTRO is not set. Please set it to the desired ROS distribution (e.g., foxy, galactic, etc.)"
exit 1
fi

source /opt/ros/${ROS_DISTRO}/setup.bash

# Create deb or colcon build
if [ "$1" = 'deb' ]; then
bash /debiab.bash
elif [ "$1" = 'bash' ]; then
bash
else
colcon "$@"
fi
15 changes: 3 additions & 12 deletions create_debian_packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ inputs:
platform:
description: "Platform (amd64 or aarch64)"
default: "amd64"
out-dir:
out_dir:
description: "Packages output directory"
default: "./deb"

runs:
using: composite
steps:
- name: Create debian packages
run: |
mkdir ${{ github.workspace }}/debs
docker run --rm -v ${{ github.workspace }}:/ws -v $PWD/${{ inputs.out-dir }}:/debs \
-v ${{ github.action_path }}/scripts:/scripts -w /ws \
-e ORIG_UID=$(id -u) -e ORIG_GID=$(id -g) \
ghcr.io/fortefibre/buildroot:${{ inputs.rosdistro }}-${{ inputs.platform }} \
/scripts/build.bash
shell: bash
using: docker
image: ghcr.io/fortefibre/buildroot:${{ inputs.rosdistro }}-${{ inputs.platform }}

0 comments on commit 4045d2e

Please sign in to comment.