-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·30 lines (22 loc) · 968 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
KUBERNETES_RELEASE_VERSION="$(curl -sSL https://dl.k8s.io/release/stable.txt)"
KUBERNETES_VERSION=${INPUT_KUBERNETES_VERSION:=${KUBERNETES_RELEASE_VERSION}}
echo "currect version ${KUBERNETES_VERSION}"
curl -O -L https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubeadm
chmod +x kubeadm
images=$(./kubeadm config images list --kubernetes-version=${KUBERNETES_VERSION})
echo "image list: ${images}"
echo "${INPUT_PASSWORD}" | docker login -u ${INPUT_USERNAME} --password-stdin ${INPUT_REGISTRY}
while IFS='/' read key value; do
image=${key}/${value}
docker pull ${image}
if [[ "${value}" == "coredns/coredns"* ]]; then
value=${value/coredns\//""}
fi
new_image=${INPUT_REPOSITORY}/${value}
if [ -n "${INPUT_REGISTRY}" ]; then
new_image=${INPUT_REGISTRY}/${new_image}
fi
docker tag ${image} ${new_image}
docker push ${new_image}
done <<< ${images}