diff --git a/build.sh b/build.sh index f6917f3..b5b27f3 100755 --- a/build.sh +++ b/build.sh @@ -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