mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add nvidia docker to build.
This commit is contained in:
parent
83b0110d66
commit
8026360669
@ -77,6 +77,21 @@ build_arm() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build_nvidia() {
|
||||||
|
if [ "$1" = "base" ]
|
||||||
|
then
|
||||||
|
# build nvidia base
|
||||||
|
docker build -t "${BUILD_IMAGE}:nvidia-base" -f base/Dockerfile.nvidia "${BASE}"
|
||||||
|
elif [ -f "$1/Dockerfile.nvidia" ]
|
||||||
|
then
|
||||||
|
# build dedicated nvidia image
|
||||||
|
docker build -t "${BUILD_IMAGE}:nvidia-$1" --build-arg="BASE_IMAGE=${BUILD_IMAGE}:nvidia-base" -f "$1/Dockerfile.nvidia" "$1/"
|
||||||
|
else
|
||||||
|
# try to build nvidia image with common Dockerfile
|
||||||
|
docker build -t "${BUILD_IMAGE}:nvidia-$1" --build-arg="BASE_IMAGE=${BUILD_IMAGE}:nvidia-base" -f "$1/Dockerfile" "$1/"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
client) build_client;;
|
client) build_client;;
|
||||||
server) build_server;;
|
server) build_server;;
|
||||||
@ -84,6 +99,9 @@ case $1 in
|
|||||||
# build arm- images
|
# build arm- images
|
||||||
arm-*) build_arm "${1#arm-}";;
|
arm-*) build_arm "${1#arm-}";;
|
||||||
|
|
||||||
|
# build nvidia- images
|
||||||
|
nvidia-*) build_nvidia "${1#nvidia-}";;
|
||||||
|
|
||||||
# build images
|
# build images
|
||||||
*) build "$1";;
|
*) build "$1";;
|
||||||
esac
|
esac
|
||||||
|
@ -17,6 +17,7 @@ if [ ! -f "${BINARY_PATH}" ] || [ "$1" == "-r" ]; then
|
|||||||
./rebuild-server
|
./rebuild-server
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# use --gpus all to enable GPU acceleration
|
||||||
docker run --rm -it \
|
docker run --rm -it \
|
||||||
--name "neko_dev" \
|
--name "neko_dev" \
|
||||||
-p "${SERVER_PORT}:8080" \
|
-p "${SERVER_PORT}:8080" \
|
||||||
|
Loading…
Reference in New Issue
Block a user