Files
kubesphere/hack/docker_build.sh
zryfish 693a4143db reconcile host cluster (#2354)
print friendly error when component failed

update dockerfile
2020-07-08 23:55:13 +08:00

25 lines
656 B
Bash
Executable File

#!/usr/bin/env bash
set -ex
set -o pipefail
tag_for_branch() {
local tag=$1
if [[ "${tag}" == "master" ]]; then
tag="latest"
fi
echo ${tag}
}
# push to kubespheredev with default latest tag
REPO=${REPO:-kubespheredev}
TAG=$(tag_for_branch $1)
docker build -f build/ks-apiserver/Dockerfile -t $REPO/ks-apiserver:$TAG .
docker build -f build/ks-controller-manager/Dockerfile -t $REPO/ks-controller-manager:$TAG .
# Push image to dockerhub, need to support multiple push
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push $REPO/ks-apiserver:$TAG
docker push $REPO/ks-controller-manager:$TAG