github.com/uvalib/orcid-access-ws@v0.0.0-20250612130209-7d062dbabf9d/scripts/docker/run.ksh (about)

     1  if [ -z "$DOCKER_HOST" ]; then
     2     echo "ERROR: no DOCKER_HOST defined"
     3     exit 1
     4  fi
     5  
     6  if [ -z "$DOCKER_HOST" ]; then
     7     DOCKER_TOOL=docker
     8  else
     9     DOCKER_TOOL=docker-legacy
    10  fi
    11  
    12  # set the definitions
    13  INSTANCE=orcid-access-ws
    14  NAMESPACE=uvadave
    15  
    16  # stop the running instance
    17  $DOCKER_TOOL stop $INSTANCE
    18  
    19  # remove the instance
    20  $DOCKER_TOOL rm $INSTANCE
    21  
    22  # remove the previously tagged version
    23  $DOCKER_TOOL rmi $NAMESPACE/$INSTANCE:current  
    24  
    25  # tag the latest as the current
    26  $DOCKER_TOOL tag -f $NAMESPACE/$INSTANCE:latest $NAMESPACE/$INSTANCE:current
    27  
    28  $DOCKER_TOOL run -d -p 8210:8080 --log-opt tag=$INSTANCE --name $INSTANCE $NAMESPACE/$INSTANCE:latest
    29  
    30  # return status
    31  exit $?