Skip to content

Commit

Permalink
fix: add ros distro back (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
domire8 committed Jun 7, 2024
1 parent 4028f8f commit e2e36aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ros2_ws/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG BASE_IMAGE=docker.io/library/ros
ARG BASE_TAG=iron
ARG ROS_DISTRO=iron
ARG VERSION=v0.0.0

FROM ${BASE_IMAGE}:${BASE_TAG} as environment-variables
Expand Down Expand Up @@ -69,7 +70,7 @@ RUN groupmod -n ${USER} ubuntu
RUN usermod -d ${HOME} -m ros2
RUN chfn -f "ROS2 User" ros2

FROM base-user-${BASE_TAG} as base-workspace
FROM base-user-${ROS_DISTRO} as base-workspace

RUN usermod -a -G dialout ${USER}
RUN echo "${USER} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/99_aptget
Expand Down Expand Up @@ -178,7 +179,7 @@ WORKDIR ${ROS2_WORKSPACE}
RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; colcon build"
RUN rm -rf ./src

FROM ros2-control-${BASE_TAG} as ros2-control
FROM ros2-control-${ROS_DISTRO} as ros2-control

FROM environment-variables as final
COPY --from=ros2-control / /
Expand Down
6 changes: 6 additions & 0 deletions ros2_ws/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

IMAGE_NAME=ghcr.io/aica-technology/ros2-ws
BASE_TAG=iron
ROS_DISTRO=iron

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
if [[ ! -f "${SCRIPT_DIR}"/config/sshd_entrypoint.sh ]]; then
Expand All @@ -16,6 +17,10 @@ while [ "$#" -gt 0 ]; do
BASE_TAG=$2
shift 2
;;
--ros-distro)
ROS_DISTRO=$2
shift 2
;;
-r | --rebuild)
BUILD_FLAGS+=(--no-cache)
shift 1
Expand All @@ -32,4 +37,5 @@ while [ "$#" -gt 0 ]; do
done

BUILD_FLAGS+=(--build-arg=BASE_TAG=${BASE_TAG})
BUILD_FLAGS+=(--build-arg=ROS_DISTRO=${ROS_DISTRO})
docker buildx build -t "${IMAGE_NAME}":"${BASE_TAG}" "${BUILD_FLAGS[@]}" .

0 comments on commit e2e36aa

Please sign in to comment.