2019-01-01 08:23:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2019-02-05 04:42:35 +00:00
|
|
|
cd $(dirname $0)/..
|
2019-01-01 08:23:01 +00:00
|
|
|
|
2019-11-12 23:36:04 +00:00
|
|
|
. ./scripts/version.sh
|
|
|
|
|
2019-12-12 01:53:02 +00:00
|
|
|
TAG=${TAG:-${VERSION_TAG}${SUFFIX}}
|
2019-01-01 08:23:01 +00:00
|
|
|
REPO=${REPO:-rancher}
|
2019-01-09 16:54:15 +00:00
|
|
|
IMAGE_NAME=${IMAGE_NAME:-k3s}
|
2019-01-01 08:23:01 +00:00
|
|
|
|
2019-01-09 16:54:15 +00:00
|
|
|
IMAGE=${REPO}/${IMAGE_NAME}:${TAG}
|
2020-03-25 19:34:20 +00:00
|
|
|
PROXY_OPTS=
|
|
|
|
[ -z "$http_proxy" ] || PROXY_OPTS="$PROXY_OPTS --build-arg http_proxy=$http_proxy"
|
|
|
|
[ -z "$https_proxy" ] || PROXY_OPTS="$PROXY_OPTS --build-arg https_proxy=$https_proxy"
|
|
|
|
[ -z "$no_proxy" ] || PROXY_OPTS="$PROXY_OPTS --build-arg no_proxy=$no_proxy"
|
2021-08-20 22:19:16 +00:00
|
|
|
docker build ${PROXY_OPTS} --build-arg VERSION=${VERSION} -t ${IMAGE} -f package/Dockerfile .
|
2020-09-15 18:43:27 +00:00
|
|
|
./scripts/image_scan.sh ${IMAGE}
|
2019-01-01 08:23:01 +00:00
|
|
|
echo Built ${IMAGE}
|