-
Notifications
You must be signed in to change notification settings - Fork 4
/
RUN-DOCKER.sh
executable file
·28 lines (21 loc) · 997 Bytes
/
RUN-DOCKER.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
#!/bin/bash
################################################################################
export DOCKER_RUNTIME=nvidia
# 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}_dual_ur3e_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).
docker exec -it ${CONTAINER} bash