X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Fremote-installer.git;a=blobdiff_plain;f=scripts%2Fbuild.sh;fp=scripts%2Fbuild.sh;h=ee9d89da12177e255194015a7f44454af95fd65e;hp=a73cb9f6117b2201aadf9fa4a1a7b9c317da5c1b;hb=b52e6b51fc070ae00af5c9974099a5c98a8e5bff;hpb=7fa7d82189c6ef7bca981d20563c16fd2300b7c7 diff --git a/scripts/build.sh b/scripts/build.sh index a73cb9f..ee9d89d 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -16,32 +16,39 @@ cd "$(dirname "$0")"/.. TAR_IMAGE="remote-installer.tar" +DOCKERFILE='docker-build/remote-installer/Dockerfile' help() { - echo -e "$(basename $0) [-hs]" - echo -e " -h display this help" - echo -e " -s save image as tar to $TAR_IMAGE" + echo -e "$(basename "$0") [-hs] -t " + echo -e " -h display this help" + echo -e " -s save image as tar to $TAR_IMAGE" + echo -e " -t specify docker base image tag" echo echo -e "Proxy configuration is taken from environment variables" echo -e "http_proxy, https_proxy and no_proxy" } -while getopts "hs" arg; do +while getopts "hst:" arg; do case $arg in h) help - exit 0 + exit 0 ;; s) - SAVE_IMAGE="yes" + SAVE_IMAGE="yes" + ;; + t) + BASEIMAGE_TAG="$OPTARG" ;; esac done docker build \ + --network=host \ --no-cache \ --force-rm \ + --build-arg BASEIMAGE_TAG="${BASEIMAGE_TAG}" \ --build-arg HTTP_PROXY="${http_proxy}" \ --build-arg HTTPS_PROXY="${https_proxy}" \ --build-arg NO_PROXY="${no_proxy}" \ @@ -49,7 +56,7 @@ docker build \ --build-arg https_proxy="${https_proxy}" \ --build-arg no_proxy="${no_proxy}" \ --tag remote-installer \ - --file docker-build/remote-installer/Dockerfile . + --file "${DOCKERFILE}" . # could be compressed but it's only used until there is an registry