Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temp #3

Open
pattylo opened this issue Jul 15, 2024 · 0 comments
Open

temp #3

pattylo opened this issue Jul 15, 2024 · 0 comments

Comments

@pattylo
Copy link
Member

pattylo commented Jul 15, 2024

#!/bin/bash

build container

echo "RUN YOUR OWN IMAGE"

image=$1

echo "GOT GPU? y/n:"
read got_gpu

gpu_enabled="--gpus all"

if [ "$got_gpu" == "y" ] || [ "$got_gpu" == "Y" ]; then
image="airo_noetic_hehe:${image}-gpu"
elif [ "$got_gpu" == "n" ] || [ "$got_gpu" == "N" ]; then
gpu_enabled=""
image="airo_noetic_hehe:${image}-nogpu"
else
echo "PLEASE CHECK YOUR INPUT!"
exit 1
fi

if [ "$(docker images -q $image 2> /dev/null)" == "" ]; then
echo ""
echo "ERROR. PLEASE CHECK THE EXISTENCE OF UR IMAGE!"
echo ""
exit 1
else
echo ""
fi

echo "NOW RUNNING IMAGE -> CONTAINER"
echo "CONTAINER BASED ON IMAGE: $image"

XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -

sudo docker run
-it
--network host
--privileged
$gpu_enabled
--volume=$XSOCK:$XSOCK:rw
--volume=$XAUTH:$XAUTH:rw
--env="XAUTHORITY=${XAUTH}"
--env DISPLAY=$DISPLAY
--env TERM=xterm-256color
--env ROS_HOSTNAME=192.168.10.253
--env ROS_MASTER_URI=http://192.168.10.216:11311
-v /dev:/dev
$image
/bin/bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant