X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Fremote-installer.git;a=blobdiff_plain;f=scripts%2Fbuild.sh;h=99f8f7b62d0ce987e8188f65dfe9291fba651b4c;hp=a73cb9f6117b2201aadf9fa4a1a7b9c317da5c1b;hb=da2e804b1c4fcb3d6e7ba4f4f830f268fe4a55b9;hpb=a772a381a84dd9b906a06c314b113b997bce71f4 diff --git a/scripts/build.sh b/scripts/build.sh index a73cb9f..99f8f7b 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,5 +1,6 @@ #!/bin/bash # Copyright 2019 Nokia +# Copyright 2020 ENEA # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,12 +17,21 @@ cd "$(dirname "$0")"/.. TAR_IMAGE="remote-installer.tar" +DOCKERFILE='docker-build/remote-installer/Dockerfile' + +BASEIMAGE_TAG='centos:7.6.1810' + +# For aarch64 use the closest available upstream version +if [ "$(uname -m)" = "aarch64" ]; then + BASEIMAGE_TAG='centos@sha256:df89b0a0b42916b5b31b334fd52d3e396c226ad97dfe772848bdd6b00fb42bf0' +fi + 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]" + echo -e " -h display this help" + echo -e " -s save image as tar to $TAR_IMAGE" echo echo -e "Proxy configuration is taken from environment variables" echo -e "http_proxy, https_proxy and no_proxy" @@ -31,17 +41,19 @@ while getopts "hs" arg; do case $arg in h) help - exit 0 + exit 0 ;; s) - SAVE_IMAGE="yes" + SAVE_IMAGE="yes" ;; 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 +61,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