From 621f6539e935d26d246cbd56c4d1a2194c08b0e8 Mon Sep 17 00:00:00 2001 From: alex berg Date: Fri, 8 Nov 2024 10:43:50 -0600 Subject: [PATCH] Check to see if image already exists rather than running build_image EVERY time --- scripts/enter_isaac_ros_container.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/enter_isaac_ros_container.sh b/scripts/enter_isaac_ros_container.sh index 2ea9e5d0..d62cd0d9 100755 --- a/scripts/enter_isaac_ros_container.sh +++ b/scripts/enter_isaac_ros_container.sh @@ -3,6 +3,11 @@ printf 'CONFIG_DOCKER_SEARCH_DIRS="$HOME/Lunabotics/src/isaac_ros/isaac_ros_comm image_key="ros2_humble.realsense.deepstream.user.zed.umn.gazebo" docker_arg="-v /usr/local/zed/resources:/usr/local/zed/resources -v $HOME/rosbags:/rosbags -v /usr/local/zed/settings:/usr/local/zed/settings" -bash ~/Lunabotics/scripts/build_image.sh +if docker images | grep -q "${image_key}"; then + echo "Image ${image_key} already exists" +else + echo "Building image ${image_key}" + bash ~/Lunabotics/scripts/build_image.sh +fi bash ~/Lunabotics/src/isaac_ros/isaac_ros_common/scripts/run_dev.sh -d ~/Lunabotics -i "${image_key}" -a "${docker_arg}" -v -b