-
Notifications
You must be signed in to change notification settings - Fork 10
/
RUN-DOCKER-CONTAINER.sh
executable file
·38 lines (31 loc) · 1.3 KB
/
RUN-DOCKER-CONTAINER.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
################################################################################
# Set the Docker container name from a project name (first argument).
# If no argument is given, use the current user name as the project name.
PROJECT=$1
if [ -z "${PROJECT}" ]; then
PROJECT=${USER}
fi
CONTAINER="${PROJECT}_ur-o2as_1"
echo "$0: PROJECT=${PROJECT}"
echo "$0: CONTAINER=${CONTAINER}"
# Run the Docker container in the background.
# Any changes made to './docker/docker-compose.yml' will recreate and overwrite the container.
docker-compose -p ${PROJECT} -f ./docker/docker-compose.yml up -d
################################################################################
# Display GUI through X Server by granting full access to any external client.
xhost +
################################################################################
# Enter the Docker container with a Bash shell (with or without a custom 'roslaunch' command).
case "$2" in
( "" )
docker exec -i -t ${CONTAINER} bash
;;
# ( "as_julius_default.launch" | \
# "darknet_ros_yolov3_default.launch" )
# docker exec -i -t ${CONTAINER} bash -i -c "source ~/ur-o2as/docker/scripts/run-roslaunch-repeatedly.sh $2"
# ;;
( * )
echo "Failed to enter the Docker container '${CONTAINER}': '$2' is not a valid argument value."
;;
esac