Skip to content

Commit

Permalink
nethost cmd add
Browse files Browse the repository at this point in the history
  • Loading branch information
hrjp committed Mar 6, 2024
1 parent 69405b1 commit c0d186e
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 267 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ git clone https://github.com/hrjp/rosenv
# Ubuntu 20.04
./rosenv/docker/ubuntu20/run.bash

# YOLO v5
./rosenv/docker/yolo5/run.bash

# YOLOX with ROS1 noetic
./rosenv/docker/ubuntu20/run.bash

Expand All @@ -73,6 +70,7 @@ git clone https://github.com/hrjp/rosenv
| :--- | :--- | :--- |
| -g | | GPUを使用する |
| -r | | コンテナからexitした際にコンテナを自動消去する |
| -w | | --net-host をつけないで実行する(コンテナ外とネットワークを分離する) |
| -n CONTAINER_NAME | | コンテナの名前 |
| -s SHARE_FOLDER_PATH | | コンテナ内部と共有するディレクトリのパス<br>rosbagをやデータを外部と共有する際に使用<br>(ex. shareフォルダを作ってから /home/$USER/share ) |

Expand Down
11 changes: 7 additions & 4 deletions docker/naviton_melodic/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SHARE_FOLDER_PATH=""
SHARE_FOLDER_CMD=""
GPU_CMD=""
CONTAINER_NAME_CMD="--name $CONTAINER_NAME"
NETHOST_CMD="--net=host"

usage_exit() {
echo " " 1>&2
Expand All @@ -20,7 +21,7 @@ usage_exit() {
exit 1
}

while getopts grn:s:h OPT
while getopts grwn:s:h OPT
do
case $OPT in
g ) GPU_CMD="--gpus all"
Expand All @@ -30,6 +31,9 @@ do
CONTAINER_NAME_CMD=""
echo " Remove when exit this container" 1>&2
;;
w ) NETHOST_CMD=""
echo " Not using --net=host" 1>&2
;;
n) CONTAINER_NAME=$OPTARG
CONTAINER_NAME_CMD="--name $CONTAINER_NAME"
echo " CONTAINER_NAME = $OPTARG " 1>&2
Expand Down Expand Up @@ -69,7 +73,6 @@ docker run -it $CONTAINER_NAME_CMD\
-e QT_X11_NO_MITSHM=1 \
$GPU_CMD \
$REMOVE_CMD \
--net=host \
$NETHOST_CMD \
--privileged \
$IMAGE_NAME /bin/bash

$IMAGE_NAME /bin/bash
2 changes: 1 addition & 1 deletion docker/ros2_foxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ARG ros2_ver=foxy
ENV ROS_DISTRO=$ros2_ver

#Indtall ROS2(Foxy etc..) and Install Tool for ROS2 and setup script の自動実行 and Install turtlesim and gazebo and Install ros2_example and turtulebot3_gazebo(waffle or burger)
RUN apt install -y ros-$ROS_DISTRO-desktop ros-$ROS_DISTRO-turtlesim ros-$ROS_DISTRO-gazebo-ros-pkgs \
RUN apt install -y ros-$ROS_DISTRO-desktop-full ros-$ROS_DISTRO-turtlesim ros-$ROS_DISTRO-gazebo-ros-pkgs \
python3-rosdep python3-argcomplete python3-colcon-common-extensions && \
echo "ros installed" && \
rosdep init && \
Expand Down
11 changes: 7 additions & 4 deletions docker/ros2_foxy/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SHARE_FOLDER_PATH=""
SHARE_FOLDER_CMD=""
GPU_CMD=""
CONTAINER_NAME_CMD="--name $CONTAINER_NAME"
NETHOST_CMD="--net=host"

usage_exit() {
echo " " 1>&2
Expand All @@ -20,7 +21,7 @@ usage_exit() {
exit 1
}

while getopts grn:s:h OPT
while getopts grwn:s:h OPT
do
case $OPT in
g ) GPU_CMD="--gpus all"
Expand All @@ -30,6 +31,9 @@ do
CONTAINER_NAME_CMD=""
echo " Remove when exit this container" 1>&2
;;
w ) NETHOST_CMD=""
echo " Not using --net=host" 1>&2
;;
n) CONTAINER_NAME=$OPTARG
CONTAINER_NAME_CMD="--name $CONTAINER_NAME"
echo " CONTAINER_NAME = $OPTARG " 1>&2
Expand Down Expand Up @@ -69,7 +73,6 @@ docker run -it $CONTAINER_NAME_CMD\
-e QT_X11_NO_MITSHM=1 \
$GPU_CMD \
$REMOVE_CMD \
--net=host \
$NETHOST_CMD \
--privileged \
$IMAGE_NAME /bin/bash

$IMAGE_NAME /bin/bash
2 changes: 1 addition & 1 deletion docker/ros2_galactic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ARG ros2_ver=galactic
ENV ROS_DISTRO=$ros2_ver

#Indtall ROS2(Foxy etc..) and Install Tool for ROS2 and setup script の自動実行 and Install turtlesim and gazebo and Install ros2_example and turtulebot3_gazebo(waffle or burger)
RUN apt install -y ros-$ROS_DISTRO-desktop ros-$ROS_DISTRO-turtlesim ros-$ROS_DISTRO-gazebo-ros-pkgs \
RUN apt install -y ros-$ROS_DISTRO-desktop-full ros-$ROS_DISTRO-turtlesim ros-$ROS_DISTRO-gazebo-ros-pkgs \
python3-rosdep python3-argcomplete python3-colcon-common-extensions && \
apt install -y python3-vcstool && \
echo "ros installed" && \
Expand Down
11 changes: 7 additions & 4 deletions docker/ros2_galactic/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SHARE_FOLDER_PATH=""
SHARE_FOLDER_CMD=""
GPU_CMD=""
CONTAINER_NAME_CMD="--name $CONTAINER_NAME"
NETHOST_CMD="--net=host"

usage_exit() {
echo " " 1>&2
Expand All @@ -20,7 +21,7 @@ usage_exit() {
exit 1
}

while getopts grn:s:h OPT
while getopts grwn:s:h OPT
do
case $OPT in
g ) GPU_CMD="--gpus all"
Expand All @@ -30,6 +31,9 @@ do
CONTAINER_NAME_CMD=""
echo " Remove when exit this container" 1>&2
;;
w ) NETHOST_CMD=""
echo " Not using --net=host" 1>&2
;;
n) CONTAINER_NAME=$OPTARG
CONTAINER_NAME_CMD="--name $CONTAINER_NAME"
echo " CONTAINER_NAME = $OPTARG " 1>&2
Expand Down Expand Up @@ -69,7 +73,6 @@ docker run -it $CONTAINER_NAME_CMD\
-e QT_X11_NO_MITSHM=1 \
$GPU_CMD \
$REMOVE_CMD \
--net=host \
$NETHOST_CMD \
--privileged \
$IMAGE_NAME /bin/bash

$IMAGE_NAME /bin/bash
74 changes: 0 additions & 74 deletions docker/ros2_galactic/run_without_nethost.bash

This file was deleted.

8 changes: 6 additions & 2 deletions docker/ros2_humble/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SHARE_FOLDER_PATH=""
SHARE_FOLDER_CMD=""
GPU_CMD=""
CONTAINER_NAME_CMD="--name $CONTAINER_NAME"
NETHOST_CMD="--net=host"

usage_exit() {
echo " " 1>&2
Expand All @@ -20,7 +21,7 @@ usage_exit() {
exit 1
}

while getopts grn:s:h OPT
while getopts grwn:s:h OPT
do
case $OPT in
g ) GPU_CMD="--gpus all"
Expand All @@ -30,6 +31,9 @@ do
CONTAINER_NAME_CMD=""
echo " Remove when exit this container" 1>&2
;;
w ) NETHOST_CMD=""
echo " Not using --net=host" 1>&2
;;
n) CONTAINER_NAME=$OPTARG
CONTAINER_NAME_CMD="--name $CONTAINER_NAME"
echo " CONTAINER_NAME = $OPTARG " 1>&2
Expand Down Expand Up @@ -69,7 +73,7 @@ docker run -it $CONTAINER_NAME_CMD\
-e QT_X11_NO_MITSHM=1 \
$GPU_CMD \
$REMOVE_CMD \
--net=host \
$NETHOST_CMD \
--privileged \
$IMAGE_NAME /bin/bash

74 changes: 0 additions & 74 deletions docker/ros2_humble/run_without_nethost.bash

This file was deleted.

11 changes: 7 additions & 4 deletions docker/ros_melodic/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SHARE_FOLDER_PATH=""
SHARE_FOLDER_CMD=""
GPU_CMD=""
CONTAINER_NAME_CMD="--name $CONTAINER_NAME"
NETHOST_CMD="--net=host"

usage_exit() {
echo " " 1>&2
Expand All @@ -20,7 +21,7 @@ usage_exit() {
exit 1
}

while getopts grn:s:h OPT
while getopts grwn:s:h OPT
do
case $OPT in
g ) GPU_CMD="--gpus all"
Expand All @@ -30,6 +31,9 @@ do
CONTAINER_NAME_CMD=""
echo " Remove when exit this container" 1>&2
;;
w ) NETHOST_CMD=""
echo " Not using --net=host" 1>&2
;;
n) CONTAINER_NAME=$OPTARG
CONTAINER_NAME_CMD="--name $CONTAINER_NAME"
echo " CONTAINER_NAME = $OPTARG " 1>&2
Expand Down Expand Up @@ -69,7 +73,6 @@ docker run -it $CONTAINER_NAME_CMD\
-e QT_X11_NO_MITSHM=1 \
$GPU_CMD \
$REMOVE_CMD \
--net=host \
$NETHOST_CMD \
--privileged \
$IMAGE_NAME /bin/bash

$IMAGE_NAME /bin/bash
Loading

0 comments on commit c0d186e

Please sign in to comment.