File tree 2 files changed +26
-8
lines changed
2 files changed +26
-8
lines changed Original file line number Diff line number Diff line change 1
- FROM amazon/aws-cli
1
+ FROM amazon/aws-cli:latest
2
2
3
- RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && \
4
- curl -L -o /usr/local/bin/aws-iam-authenticator https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v0.5.7/aws-iam-authenticator_0.5.7_linux_amd64 && \
5
- chmod +x /usr/local/bin/aws-iam-authenticator && \
6
- chmod +x ./kubectl && \
7
- mv ./kubectl /usr/bin/kubectl
3
+ RUN yum install jq -y && curl -sL -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
4
+ curl -sL -o /usr/bin/aws-iam-authenticator $(curl -s https://api.github.com/repos/kubernetes-sigs/aws-iam-authenticator/releases/latest | jq -r ' .assets[] | select(.name | contains("linux_amd64") )' | jq -r '.browser_download_url' ) && \
5
+ chmod +x /usr/bin/aws-iam-authenticator && \
6
+ chmod +x /usr/bin/kubectl
8
7
9
- RUN kubectl version --client
10
8
COPY entrypoint.sh /entrypoint.sh
11
9
ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change 6
6
echo " $KUBE_CONFIG_DATA " | base64 -d > /tmp/config
7
7
export KUBECONFIG=/tmp/config
8
8
9
- sh -c " kubectl $* "
9
+ if [ -z ${KUBECTL_VERSION+x} ] ; then
10
+ echo " Using kubectl version: $( kubectl version --client --short) "
11
+ else
12
+ echo " Pulling kubectl for version $KUBECTL_VERSION "
13
+ rm /usr/bin/kubectl
14
+ curl -sL -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/" $KUBECTL_VERSION " /bin/linux/amd64/kubectl && \
15
+ chmod +x /usr/bin/kubectl
16
+ echo " Using kubectl version: $( kubectl version --client --short) "
17
+ fi
18
+
19
+ if [ -z ${IAM_VERSION+x} ] ; then
20
+ echo " Using aws-iam-authenticator version: $( aws-iam-authenticator version) "
21
+ else
22
+ echo " Pulling aws-iam-authenticator for version $IAM_VERSION "
23
+ rm /usr/bin/aws-iam-authenticator
24
+ curl -sL -o /usr/bin/aws-iam-authenticator https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v" $IAM_VERSION " /aws-iam-authenticator_" $IAM_VERSION " _linux_amd64 && \
25
+ chmod +x /usr/bin/aws-iam-authenticator
26
+ echo " Using aws-iam-authenticator version: $( aws-iam-authenticator version) "
27
+ fi
28
+
29
+ sh -c " kubectl $* "
You can’t perform that action at this time.
0 commit comments