Skip to content

Commit aadc1fe

Browse files
[update] Update 'pytorch_enet_ros' and 'Dockerfile'
1 parent 52e82f1 commit aadc1fe

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ COPY requirements.txt /tmp
77

88
RUN pip install -r /tmp/requirements.txt && rm -rf /tmp/requirements.txt
99

10-
RUN apt-get update && apt install -y lsb-release \
10+
RUN apt-get update && apt install -y lsb-release net-tools \
1111
&& apt-get clean \
1212
&& rm -rf /var/lib/apt/lists/*rm
1313

@@ -16,12 +16,10 @@ RUN apt-get update && apt install -y lsb-release \
1616
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' && \
1717
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
1818

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 \
2523
python-catkin-tools \
2624
&& apt-get clean \
2725
&& rm -rf /var/lib/apt/lists/*rm
@@ -52,6 +50,7 @@ RUN rm /ros_entrypoint.sh
5250
COPY ./ros_entrypoint.sh /ros_entrypoint.sh
5351
RUN chmod 777 /ros_entrypoint.sh
5452

53+
RUN echo 'network_if=eth0' >> ~/.bashrc
5554
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
5655
RUN echo 'if [ -z "$TARGET_IP" ] ; then' >> ~/.bashrc
5756
RUN echo ' echo "ROS_IP is not set."' >> ~/.bashrc

ros_entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -e
55
source "/opt/ros/$ROS_DISTRO/setup.bash"
66
source "/root/catkin_ws/devel/setup.bash"
77

8+
network_if=eth0
89
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]*')
910
if [ -z "$TARGET_IP" ] ; then
1011
echo "ROS_IP is not set."

0 commit comments

Comments
 (0)