4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 cd "$(dirname "$0")"/..
18 TAR_IMAGE="remote-installer.tar"
19 DOCKERFILE='docker-build/remote-installer/Dockerfile'
23 echo -e "$(basename "$0") [-hs] -t <tag>"
24 echo -e " -h display this help"
25 echo -e " -s save image as tar to $TAR_IMAGE"
26 echo -e " -t <tag> specify docker base image tag"
28 echo -e "Proxy configuration is taken from environment variables"
29 echo -e "http_proxy, https_proxy and no_proxy"
32 while getopts "hst:" arg; do
42 BASEIMAGE_TAG="$OPTARG"
51 --build-arg BASEIMAGE_TAG="${BASEIMAGE_TAG}" \
52 --build-arg HTTP_PROXY="${http_proxy}" \
53 --build-arg HTTPS_PROXY="${https_proxy}" \
54 --build-arg NO_PROXY="${no_proxy}" \
55 --build-arg http_proxy="${http_proxy}" \
56 --build-arg https_proxy="${https_proxy}" \
57 --build-arg no_proxy="${no_proxy}" \
58 --tag remote-installer \
59 --file "${DOCKERFILE}" .
62 # could be compressed but it's only used until there is an registry
63 if [ -n "$SAVE_IMAGE" ]
65 echo -e "Creating image tar ball at : $(dirname "$0")/$TAR_IMAGE"
66 docker image save remote-installer >"$(dirname "$0")"/"$TAR_IMAGE"