neko/server/dev/go
2024-06-23 17:48:14 +02:00

26 lines
564 B
Bash
Executable File

#!/bin/bash
cd "$(dirname "$0")"
if [ "$(docker images -q neko_server_build 2> /dev/null)" == "" ]; then
echo "Image 'neko_server_build' not found. Run ./build first."
exit 1
fi
docker run -it \
--name "neko_server_go" \
--entrypoint="go" \
-v "${PWD}/../:/src" \
neko_server_build "$@";
#
# copy package files
docker cp neko_server_go:/src/go.mod "../go.mod"
docker cp neko_server_go:/src/go.sum "../go.sum"
#
# commit changes to image
docker commit "neko_server_go" "neko_server_build"
#
# remove contianer
docker rm "neko_server_go"