ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

arwtyxouymz's profile - activity

2019-11-13 07:24:00 -0500 received badge  Student (source)
2019-11-13 07:23:45 -0500 marked best answer 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.

2019-07-01 18:27:47 -0500 received badge  Famous Question (source)
2019-04-18 00:30:10 -0500 received badge  Enthusiast
2019-04-09 16:08:57 -0500 received badge  Notable Question (source)
2019-04-06 04:07:32 -0500 commented answer Unable to override osrf/ros entrypoint

Thank you Andrew! I removed set -e flag, and succeeded to run a container. But with docker-compose, ros cannot find my

2019-04-06 03:27:29 -0500 received badge  Popular Question (source)
2019-04-05 05:47:41 -0500 asked a question Unable to override osrf/ros entrypoint

Unable to override osrf/ros entrypoint Hi This is my first post and I'm very confusing about ROS + docker. What i want