diff --git a/Legacy/Dockerfile b/Legacy/Dockerfile index dae1d8f..82c92a3 100644 --- a/Legacy/Dockerfile +++ b/Legacy/Dockerfile @@ -1,6 +1,7 @@ FROM irth7/ros:hydro as build -RUN apt-get update && apt-get install -y ros-hydro-tf ros-hydro-dynamic-reconfigure ros-hydro-nav-msgs ros-hydro-hokuyo-node && rm -rf /var/lib/apt/lists/* +RUN sed -i 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list && cat /etc/apt/sources.list +RUN apt-get update && apt-get install -y ros-hydro-tf ros-hydro-dynamic-reconfigure ros-hydro-nav-msgs ros-hydro-hokuyo-node COPY ws_linux /home/lab1_5/ws/ws_linux ADD Aria /usr/local/Aria COPY entrypoint.sh /entrypoint.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..599dfbb --- /dev/null +++ b/install.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Check if root +if [ "$EUID" -ne 0 ] + then echo "Please run as root" + exit +fi + +cp rosaria-docker.service /etc/systemd/system/ +chmod g+w /etc/systemd/system/rosaria-docker.service +systemctl daemon-reload +systemctl enable rosaria-docker.service +systemctl start rosaria-docker.service diff --git a/rosaria-docker.service b/rosaria-docker.service new file mode 100644 index 0000000..63c278c --- /dev/null +++ b/rosaria-docker.service @@ -0,0 +1,9 @@ +[Unit] +After=network.service + +[Service] +ExecStart=/home/lab1_5/rosaria/run.sh + +[Install] +WantedBy=default.target + diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..0d02c4b --- /dev/null +++ b/run.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Script running rosaria inside docker container +echo "ID: $PIONIER_ID" + +docker run --privileged --network=host --device=/dev/ttyS0 -i -e ROS_IP=$(hostname -I | awk '{print $1}') -e PIONIER_ID=$(hostname | sed 's/[^0-9]//g' +) irth7/rosaria-legacy