diff --git a/run.sh b/run.sh index 77fc831..08c3434 100755 --- a/run.sh +++ b/run.sh @@ -47,19 +47,14 @@ elif [[ $FORCE_BUILD = 1 ]] || ! echo "$IMAGE_EXISTS" | grep -q "$TAG"; then USERID=$(id -u) GROUPID=$(id -g) docker build -t $REPOSITORY:$TAG --build-arg hostuid=$USERID --build-arg hostgid=$GROUPID . - OK=$? # After successful build, delete existing containers IS_EXISTING=$(docker inspect -f '{{.Id}}' $CONTAINER 2>/dev/null) - if [[ $OK -eq 0 ]] && [[ -n "$IS_EXISTING" ]]; then + if [[ -n $IS_EXISTING ]]; then docker rm $CONTAINER fi fi -if [[ $OK -ne 0 ]]; then - exit 1 -fi - # With the given name $CONTAINER, reconnect to running container, start # an existing/stopped container or run a new one if one does not exist. IS_RUNNING=$(docker inspect -f '{{.State.Running}}' $CONTAINER 2>/dev/null)