github.com/mysteriumnetwork/node@v0.0.0-20240516044423-365054f76801/bin/builder_package (about)

     1  #!/bin/bash
     2  set -e
     3  
     4  ###########################################################################
     5  # Creates builder Docker image and uploads it to DockerHub https://hub.docker.com/r/mysteriumnetwork/mysterium-node-builder/
     6  #
     7  # Usage:
     8  #> bin/builder_package [tag..]
     9  #
    10  # Build local image:
    11  #> bin/builder_package
    12  #
    13  # Build image and push to docker hub:
    14  #> bin/builder_package latest
    15  
    16  DOCKER_IMAGE="mysteriumnetwork/mysterium-node-builder"
    17  
    18  printf "Building Docker image '$DOCKER_IMAGE' ..\n" \
    19      && docker build \
    20          --file bin/builder_docker/Dockerfile \
    21          --tag $DOCKER_IMAGE \
    22          .
    23  if [ $? -ne 0 ] ; then
    24      printf "\e[0;31m%s\e[0m\n" "Failed to build Docker image!"
    25      exit 1
    26  fi
    27  
    28  while test $# -gt 0; do
    29      DOCKER_TAG=$1; shift;
    30      printf "Publishing version '$DOCKER_TAG' image..\n" \
    31          && docker tag $DOCKER_IMAGE $DOCKER_IMAGE:$DOCKER_TAG \
    32          && docker push $DOCKER_IMAGE:$DOCKER_TAG
    33  done
    34  
    35  printf "\e[0;32m%s\e[0m\n" "Docker image building process complete!"
    36