Unable to override osrf/ros entrypoint
Hi
This is my first post and I'm very confusing about ROS + docker.
What i want to do is to override osrf/ros
entrypoints.
The entrypoint's difference is just added to source my workspace's setup.bash
.
This is my entrypoint.sh
#!/usr/bin/env bash
set -e
# setup ros environment
source "/opt/ros/$ROS_DISTRO/setup.bash"
source "/catkin_ws/devel/setup.bash"
exec "$@"
And I modified Dockerfile
to create workspace and build package.
This is my Dockerfile
FROM osrf/ros:kinetic-desktop-full
# For Nvidia GPU
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
RUN apt-get update && apt-get install -y --no-install-recommends \
libxext-dev libx11-dev x11proto-gl-dev dh-autoreconf\
&& rm -rf /var/lib/apt/lists/ \
&& git clone https://github.com/NVIDIA/libglvnd && cd libglvnd \\
&& ./autogen.sh && ./configure && make -j4 && make install
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ros-kinetic-ridgeback-* \
&& mkdir -p /catkin_ws/src && cd /catkin_ws/src \
&& . /opt/ros/kinetic/setup.sh \
&& git clone https://github.com/ridgeback/ridgeback_robot \
&& rosdep install --from-path . -r -y --ignore-src \
&& rm -rf /var/lib/apt/lists/ \
&& cd /catkin_ws && catkin_make
COPY ./entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]
Then, I run docker run -it <myimage>
, docker container shutdown immediately.
However, If i removed source "/catkin_ws/devel/setup.bash
, container will start. So i think /catkin_ws/devel/setup.bash
is a problem, but I don't know how to solve it because if i run docker logs <containerID> --details
, no logs appeared.
Could someone help me?
I use Ubuntu:18.04 and melodic is installed in my local environment.