-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup_docker.sh
39 lines (33 loc) · 1.03 KB
/
setup_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
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# ##############################################################################
# Script setup
# ##############################################################################
threads='1'
cuda_version=''
cuda=''
while getopts c:j: flag; do
case "${flag}" in
j) threads=${OPTARG} ;;
c) cuda_version=${OPTARG}
cuda='-c' ;;
esac
done
scriptpath="$(
cd -- "$(dirname "$0")" >/dev/null 2>&1
pwd -P
)"
# if cuda_version is set, use the cuda base container
if [ -z "${cuda_version}" ]; then
base="rockylinux:9"
else
base="nvidia/cuda:${cuda_version}-devel-rockylinux9"
fi
echo
echo " Docker build Threads: ${threads}"
echo " CUDA base container: ${base}"
echo
# ##############################################################################
# Run docker build
# ##############################################################################
echo " Building DiFfRG docker image..."
docker buildx build -t diffrg . --build-arg base=${base} --build-arg threads=${threads} --build-arg cuda=${cuda}