build.sh: check permissions

This commit is contained in:
augustin64 2024-04-03 15:42:14 +02:00
parent 1d16294c04
commit 9af0f4aadb
1 changed files with 12 additions and 2 deletions

View File

@ -1,2 +1,12 @@
docker build --network host -t msrewards .
docker run -d --restart unless-stopped -p 1234:1234 -p 2345:2345 -ti --shm-size=2gb --name MsRewards msrewards
#!/bin/bash
docker-do () { # Check if sudo needs to be used
if id -nG "$(whoami)" | grep -qw "docker"; then
docker $@
else
sudo docker $@
fi
}
docker-do build --network host -t msrewards .
docker-do run -d --restart unless-stopped -p 1234:1234 -p 2345:2345 -ti --shm-size=2gb --name MsRewards msrewards