From 8fc845fa1e48367a7a0e69aa7562d627c6e6dfba Mon Sep 17 00:00:00 2001 From: jfkeller Date: Wed, 29 Jan 2025 13:40:41 -0500 Subject: [PATCH] Jkeller/robot dockerfile bugfix (#197) * trying to debug libimath problem * debugging * fixed bug in arg usage * fixed issue where apt installing libimath-dev for the sim robot was causing necessary ros2 packages from being automatically removed, breaking the build. This issue doesn't happen when libimath-dev is installed on the jetsons --------- Co-authored-by: caomuqing --- robot/docker/Dockerfile.robot | 15 +++++++++++++-- robot/docker/docker-compose.yaml | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/robot/docker/Dockerfile.robot b/robot/docker/Dockerfile.robot index 46c4557a..b0c4f85d 100644 --- a/robot/docker/Dockerfile.robot +++ b/robot/docker/Dockerfile.robot @@ -110,7 +110,7 @@ RUN apt remove -y libopenvdb*; \ cd ..; rm -rf /opt/openvdb/build # Add ability to SSH -RUN apt-get update && apt-get install -y openssh-server libimath-dev +RUN apt-get update && apt-get install -y openssh-server RUN mkdir /var/run/sshd # Password is airstack @@ -120,7 +120,18 @@ RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/ RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd EXPOSE 22 - + +ARG REAL_ROBOT=false +RUN if [ "$REAL_ROBOT" = "true" ]; then \ + # Put commands here that should run for the real robot but not the sim + + echo "REAL_ROBOT is true"; \ + apt-get update && apt-get install -y libimath-dev; \ +else \ + # Put commands here that should be run for the sim but not the real robot + + echo "REAL_ROBOT is false"; \ +fi # Cleanup. Prevent people accidentally doing git commits as root in Docker RUN apt purge git -y \ diff --git a/robot/docker/docker-compose.yaml b/robot/docker/docker-compose.yaml index cad0b454..201c1657 100644 --- a/robot/docker/docker-compose.yaml +++ b/robot/docker/docker-compose.yaml @@ -47,6 +47,7 @@ services: dockerfile: ./Dockerfile.robot args: BASE_IMAGE: nvcr.io/nvidia/l4t-jetpack:r36.4.0 + REAL_ROBOT: true tags: - *l4t_image # we use tmux send-keys so that the session stays alive