2022-07-14 10:55:56 +12:00
|
|
|
#!/bin/bash
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
|
|
#
|
|
|
|
# aborting if any command returns a non-zero value
|
|
|
|
set -e
|
|
|
|
|
|
|
|
GIT_COMMIT=`git rev-parse --short HEAD`
|
|
|
|
GIT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD`
|
|
|
|
|
2023-04-05 09:52:15 +12:00
|
|
|
# if first argument is nvidia, use nvidia dockerfile
|
|
|
|
if [ "$1" = "nvidia" ]; then
|
|
|
|
echo "Building nvidia docker image"
|
|
|
|
DOCKERFILE="Dockerfile.nvidia"
|
|
|
|
else
|
|
|
|
echo "Building default docker image"
|
|
|
|
DOCKERFILE="Dockerfile"
|
|
|
|
fi
|
2022-07-14 10:55:56 +12:00
|
|
|
|
2023-04-05 09:52:15 +12:00
|
|
|
docker build -t neko_server_build --target build --build-arg "GIT_COMMIT=$GIT_COMMIT" --build-arg "GIT_BRANCH=$GIT_BRANCH" -f ../$DOCKERFILE ..
|
|
|
|
docker build -t neko_server_runtime --target runtime --build-arg "GIT_COMMIT=$GIT_COMMIT" --build-arg "GIT_BRANCH=$GIT_BRANCH" -f ../$DOCKERFILE ..
|
|
|
|
|
|
|
|
docker build -t neko_server_app --build-arg "BASE_IMAGE=neko_server_runtime" -f ./runtime/$DOCKERFILE ./runtime
|