From d47acbd8b64e346b84b72fd76702c852a9df3385 Mon Sep 17 00:00:00 2001 From: Isaac Saito <130s@2000.jukuin.keio.ac.jp> Date: Sat, 9 Sep 2023 14:36:37 -0400 Subject: [PATCH 1/2] Feature: Option to take Docker image Signed-off-by: Isaac Saito <130s@2000.jukuin.keio.ac.jp> --- build.bash | 3 ++- humble/Dockerfile | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build.bash b/build.bash index 68058df..05327b9 100755 --- a/build.bash +++ b/build.bash @@ -20,6 +20,7 @@ # Builds a Docker image. image_name=dockwater distro=$(basename $1) +image_base=${2:-ros:$distro-ros-base-jammy} if [ $# -lt 1 ] then @@ -34,7 +35,7 @@ then fi image_plus_tag=$image_name:$(export LC_ALL=C; date +%Y_%m_%d_%H%M) -docker build --rm -t $image_plus_tag -f "${1}"/Dockerfile "${1}" && \ +docker build --rm --build-arg BASE_IMG=$image_base -t $image_plus_tag -f "${1}"/Dockerfile "${1}" && \ docker tag $image_plus_tag $image_name:$distro && \ echo "Built $image_plus_tag and tagged as $image_name:$distro" echo "To run:" diff --git a/humble/Dockerfile b/humble/Dockerfile index d3f3c0f..cdf0a6e 100644 --- a/humble/Dockerfile +++ b/humble/Dockerfile @@ -1,5 +1,7 @@ +ARG BASE_IMG=ros:humble-ros-base-jammy + # Ubuntu 22.04 -FROM ros:humble-ros-base-jammy +FROM $BASE_IMG # Setup timezone ENV TZ=Etc/UTC @@ -37,7 +39,7 @@ RUN apt update && \ pkg-config \ protobuf-compiler \ python3-dbg \ - python3-empy \ +ros:$distro-ros-base-jammy python3-empy \ python3-numpy \ python3-setuptools \ python3-pip \ From b42a77f52f0e6af48fc27b64282785c772ad4749 Mon Sep 17 00:00:00 2001 From: Isaac Saito <130s@2000.jukuin.keio.ac.jp> Date: Sat, 9 Sep 2023 14:39:27 -0400 Subject: [PATCH 2/2] Improve: ros-desktop is really needed? Signed-off-by: Isaac Saito <130s@2000.jukuin.keio.ac.jp> --- humble/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/humble/Dockerfile b/humble/Dockerfile index cdf0a6e..3d93dfc 100644 --- a/humble/Dockerfile +++ b/humble/Dockerfile @@ -69,8 +69,8 @@ RUN /bin/sh -c 'wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share RUN apt update \ && apt install -y --no-install-recommends \ gz-${GZDIST} \ - ros-${ROSDIST}-desktop \ - && rm -rf /var/lib/apt/lists/* \ + ros-${ROSDIST}-ros-base \ + && rm -rf /var/lib/apt/lists/* \ && apt clean -qq # Install some 'standard' ROS packages and utilities.