@@ -7,7 +7,7 @@ COPY requirements.txt /tmp
7
7
8
8
RUN pip install -r /tmp/requirements.txt && rm -rf /tmp/requirements.txt
9
9
10
- RUN apt-get update && apt install -y lsb-release \
10
+ RUN apt-get update && apt install -y lsb-release net-tools \
11
11
&& apt-get clean \
12
12
&& rm -rf /var/lib/apt/lists/*rm
13
13
@@ -16,12 +16,10 @@ RUN apt-get update && apt install -y lsb-release \
16
16
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' && \
17
17
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
18
18
19
- # Install ROS Melodic
20
- RUN apt-get update && apt install -y ros-kinetic-ros-base \
21
- && apt-get clean \
22
- && rm -rf /var/lib/apt/lists/*rm
23
-
24
- RUN apt-get install -y ros-kinetic-image-transport ros-kinetic-image-transport-plugins \
19
+ RUN apt update && \
20
+ apt install -y ros-kinetic-ros-base \
21
+ ros-kinetic-image-transport \
22
+ ros-kinetic-image-transport-plugins \
25
23
python-catkin-tools \
26
24
&& apt-get clean \
27
25
&& rm -rf /var/lib/apt/lists/*rm
@@ -52,6 +50,7 @@ RUN rm /ros_entrypoint.sh
52
50
COPY ./ros_entrypoint.sh /ros_entrypoint.sh
53
51
RUN chmod 777 /ros_entrypoint.sh
54
52
53
+ RUN echo 'network_if=eth0' >> ~/.bashrc
55
54
RUN echo 'export TARGET_IP=$(LANG=C /sbin/ifconfig $network_if | grep -Eo ' "'" 'inet (addr:)?([0-9]*\. ){3}[0-9]*' "'" ' | grep -Eo ' "'" '([0-9]*\. ){3}[0-9]*' "'" ')' >> ~/.bashrc
56
55
RUN echo 'if [ -z "$TARGET_IP" ] ; then' >> ~/.bashrc
57
56
RUN echo ' echo "ROS_IP is not set."' >> ~/.bashrc
0 commit comments