5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 cd "$(dirname "$0")"/..
19 TAR_IMAGE="remote-installer.tar"
20 DOCKERFILE='docker-build/remote-installer/Dockerfile'
22 BASEIMAGE_TAG='centos:7.6.1810'
24 # For aarch64 use the closest available upstream version
25 if [ "$(uname -m)" = "aarch64" ]; then
26 BASEIMAGE_TAG='centos@sha256:df89b0a0b42916b5b31b334fd52d3e396c226ad97dfe772848bdd6b00fb42bf0'
32 echo -e "$(basename "$0") [-hs]"
33 echo -e " -h display this help"
34 echo -e " -s save image as tar to $TAR_IMAGE"
36 echo -e "Proxy configuration is taken from environment variables"
37 echo -e "http_proxy, https_proxy and no_proxy"
40 while getopts "hs" arg; do
56 --build-arg BASEIMAGE_TAG="${BASEIMAGE_TAG}" \
57 --build-arg HTTP_PROXY="${http_proxy}" \
58 --build-arg HTTPS_PROXY="${https_proxy}" \
59 --build-arg NO_PROXY="${no_proxy}" \
60 --build-arg http_proxy="${http_proxy}" \
61 --build-arg https_proxy="${https_proxy}" \
62 --build-arg no_proxy="${no_proxy}" \
63 --tag remote-installer \
64 --file "${DOCKERFILE}" .
67 # could be compressed but it's only used until there is an registry
68 if [ -n "$SAVE_IMAGE" ]
70 echo -e "Creating image tar ball at : $(dirname "$0")/$TAR_IMAGE"
71 docker image save remote-installer >"$(dirname "$0")"/"$TAR_IMAGE"