From 491289b441b0c1d39e9a586e5598d5bf47af7c9e Mon Sep 17 00:00:00 2001 From: Jakub Mandula Date: Wed, 31 Jan 2024 17:05:50 +0100 Subject: [PATCH] Write export and source to /root/.bashrc in Dockerfiles to make them effective on container launch --- Dockerfile_ros1_16_04 | 9 +++------ Dockerfile_ros1_18_04 | 7 +++---- Dockerfile_ros1_20_04 | 8 ++++---- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Dockerfile_ros1_16_04 b/Dockerfile_ros1_16_04 index 674e01908..bc297e031 100644 --- a/Dockerfile_ros1_16_04 +++ b/Dockerfile_ros1_16_04 @@ -37,13 +37,10 @@ RUN cd $WORKSPACE &&\ # When a user runs a command we will run this code before theirs # This will allow for using the manual focal length if it fails to init # https://github.com/ethz-asl/kalibr/pull/346 -ENTRYPOINT export KALIBR_MANUAL_FOCAL_LENGTH_INIT=1 && \ - # /bin/bash -c "source \"$WORKSPACE/devel/setup.bash\"" && \ - cd $WORKSPACE && \ - /bin/bash - - +RUN echo "export KALIBR_MANUAL_FOCAL_LENGTH_INIT=1" >> /root/.bashrc && \ + echo 'source "$WORKSPACE/devel/setup.bash"' >> /root/.bashrc +ENTRYPOINT ["/bin/bash"] diff --git a/Dockerfile_ros1_18_04 b/Dockerfile_ros1_18_04 index 9820a40a9..32ed80680 100644 --- a/Dockerfile_ros1_18_04 +++ b/Dockerfile_ros1_18_04 @@ -39,11 +39,10 @@ RUN cd $WORKSPACE &&\ # When a user runs a command we will run this code before theirs # This will allow for using the manual focal length if it fails to init # https://github.com/ethz-asl/kalibr/pull/346 -ENTRYPOINT export KALIBR_MANUAL_FOCAL_LENGTH_INIT=1 && \ - # /bin/bash -c "source \"$WORKSPACE/devel/setup.bash\"" && \ - cd $WORKSPACE && \ - /bin/bash +RUN echo "export KALIBR_MANUAL_FOCAL_LENGTH_INIT=1" >> /root/.bashrc && \ + echo 'source "$WORKSPACE/devel/setup.bash"' >> /root/.bashrc +ENTRYPOINT ["/bin/bash"] diff --git a/Dockerfile_ros1_20_04 b/Dockerfile_ros1_20_04 index 469e032f5..ecc90f050 100644 --- a/Dockerfile_ros1_20_04 +++ b/Dockerfile_ros1_20_04 @@ -35,10 +35,10 @@ RUN cd $WORKSPACE &&\ # When a user runs a command we will run this code before theirs # This will allow for using the manual focal length if it fails to init # https://github.com/ethz-asl/kalibr/pull/346 -ENTRYPOINT export KALIBR_MANUAL_FOCAL_LENGTH_INIT=1 && \ - # /bin/bash -c "source \"$WORKSPACE/devel/setup.bash\"" && \ - cd $WORKSPACE && \ - /bin/bash +RUN echo "export KALIBR_MANUAL_FOCAL_LENGTH_INIT=1" >> /root/.bashrc && \ + echo 'source "$WORKSPACE/devel/setup.bash"' >> /root/.bashrc + +ENTRYPOINT ["/bin/bash"]