Handle errors when building the Docker container correctly.

master
Pacman Ghost 4 years ago
parent 689e6122ac
commit d561c5be00
  1. 7
      run-container.sh

@ -108,15 +108,15 @@ fi
# build the container # build the container
if [ -z "$NO_BUILD" ]; then if [ -z "$NO_BUILD" ]; then
echo Building the container... echo Building the \"$TAG\" container...
docker build . --tag vasl-templates:$TAG 2>&1 \ docker build . --tag vasl-templates:$TAG 2>&1 \
| sed -e 's/^/ /' | sed -e 's/^/ /'
if [ $? -ne 0 ]; then exit 10 ; fi if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 10 ; fi
echo echo
fi fi
# launch the container # launch the container
echo Launching the container... echo Launching the \"$TAG\" container...
docker run \ docker run \
--publish $PORT:5010 \ --publish $PORT:5010 \
--name vasl-templates \ --name vasl-templates \
@ -127,3 +127,4 @@ docker run \
vasl-templates:$TAG \ vasl-templates:$TAG \
2>&1 \ 2>&1 \
| sed -e 's/^/ /' | sed -e 's/^/ /'
exit ${PIPESTATUS[0]}

Loading…
Cancel
Save