Skip to content

Commit d99a33c

Browse files
authored
Fix docker scripts incompatibilities with non-GPU and graphics (#44)
remove GPU and graphic related flags in docker run as they are not needed Signed-off-by: Xavier Ruiz <xavier.ruiz@ekumenlabs.com>
1 parent 79a2e4d commit d99a33c

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

docker/join.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,5 @@ if [[ ${#ARGS[@]} -eq 0 ]]; then
4141
ARGS=("bash")
4242
fi
4343

44-
# Allow GUI applications
45-
xhost +
46-
4744
# Join a running container
4845
docker exec -it "$CONTAINER_NAME" "${ARGS[@]}"
49-
50-
# Disallow GUI applications after container exits
51-
xhost -

docker/run.sh

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,6 @@ if ! docker info > /dev/null 2>&1; then
8686
exit 1
8787
fi
8888

89-
# Check for NVIDIA Container Toolkit for GPU support
90-
NVIDIA_FLAGS=""
91-
if command -v dpkg >/dev/null 2>&1 && dpkg -l | grep -q nvidia-container-toolkit; then
92-
NVIDIA_FLAGS="--gpus all"
93-
else
94-
# if dpkg isn't present (non-debian host) or toolkit not installed, we leave NVIDIA_FLAGS empty
95-
echo -e "\n\e[33mWarning:\e[0m 'nvidia-container-toolkit' not detected (or dpkg unavailable). GPU support may be disabled."
96-
fi
97-
9889
# Build if requested
9990
if [ "$BUILD_FIRST" = true ]; then
10091
echo "Building image first as requested..."
@@ -123,21 +114,12 @@ for dir in build install log; do
123114
fi
124115
done
125116

126-
# Allow GUI applications
127-
xhost +
128-
129117
# Run the container
130118
docker run -it \
131119
--user=$(id -u):$(id -g) \
132120
--net=host \
133121
${NVIDIA_FLAGS} \
134122
--name "${CONTAINER_NAME}" \
135-
-e DISPLAY=$DISPLAY \
136-
-e QT_X11_NO_MITSHM=1 \
137-
-e XDG_RUNTIME_DIR=/tmp/runtime-${USER} \
138-
-e NVIDIA_DRIVER_CAPABILITIES=all \
139-
--device /dev/dri:/dev/dri \
140-
-v /tmp/.X11-unix:/tmp/.X11-unix \
141123
-v ${REPOSITORY_FOLDER_PATH}/modules:${WORKSPACE_ROOT_CONTAINER}/src/ \
142124
-v ${REPOSITORY_FOLDER_PATH}/build:${WORKSPACE_ROOT_CONTAINER}/build/ \
143125
-v ${REPOSITORY_FOLDER_PATH}/install:${WORKSPACE_ROOT_CONTAINER}/install/ \
@@ -147,9 +129,6 @@ docker run -it \
147129
"${IMAGE_NAME}:${TAG}" \
148130
"${ARGS[@]}"
149131

150-
# Disallow GUI applications after container exits
151-
xhost -
152-
153132
# Function to be able to overwrite the image on exit
154133
function onexit() {
155134
while true; do

0 commit comments

Comments
 (0)