forked from space-ros/demos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Dockerfile and add build and run scripts (fix issue space-ros#36)
- Loading branch information
Showing
6 changed files
with
176 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
ORG=openrobotics | ||
IMAGE=lunar_pole_exploration_rover_demo | ||
TAG=latest | ||
|
||
VCS_REF="" | ||
VERSION=preview | ||
|
||
# Exit script with failure if build fails | ||
set -eo pipefail | ||
|
||
echo "" | ||
echo "##### Building Space ROS Demo Docker Image #####" | ||
echo "" | ||
|
||
docker build -t $IMAGE:$TAG \ | ||
--build-arg VCS_REF="$VCS_REF" \ | ||
--build-arg VERSION="$VERSION" . | ||
|
||
echo "" | ||
echo "##### Done! #####" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Runs a docker container with the image created by build.bash | ||
# Requires: | ||
# docker | ||
# an X server | ||
|
||
IMG_NAME=openrobotics/lunar_pole_exploration_rover_demo | ||
|
||
# Replace `/` with `_` to comply with docker container naming | ||
# And append `_runtime` | ||
CONTAINER_NAME="$(tr '/' '_' <<< "$IMG_NAME")" | ||
|
||
# Start the container | ||
docker run --rm -it --name $CONTAINER_NAME --network host \ | ||
-e DISPLAY -e TERM -e QT_X11_NO_MITSHM=1 $IMG_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Runs a docker container with the image created by build.bash | ||
# Requires: | ||
# docker | ||
# an X server | ||
|
||
IMG_NAME=openrobotics/lunar_pole_exploration_rover_demo | ||
|
||
xhost +local:docker | ||
|
||
# Replace `/` with `_` to comply with docker container naming | ||
# And append `_runtime` | ||
CONTAINER_NAME="$(tr '/' '_' <<< "$IMG_NAME")" | ||
|
||
# Start the container | ||
docker run --rm -it --name $CONTAINER_NAME \ | ||
--network host \ | ||
--privileged \ | ||
--gpus all \ | ||
-e NVIDIA_VISIBLE_DEVICES=all \ | ||
-e NVIDIA_DRIVER_CAPABILITIES=graphics \ | ||
-e DISPLAY=$DISPLAY \ | ||
-e TERM \ | ||
-e QT_X11_NO_MITSHM=1 \ | ||
-e XAUTHORITY=$XAUTHORITY \ | ||
--mount type=bind,source=/tmp/.X11-unix,target=/tmp/.X11-unix \ | ||
$IMG_NAME |