forked from PaulMaddox/amazon-eks-kubectl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
23 lines (20 loc) · 879 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM alpine:latest
ADD https://storage.googleapis.com/kubernetes-release/release/v1.11.1/bin/linux/amd64/kubectl /usr/local/bin/kubectl
ADD https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v0.3.0/heptio-authenticator-aws_0.3.0_linux_amd64 /usr/local/bin/aws-iam-authenticator
ADD kubectl.sh /usr/local/bin/kubectl.sh
RUN set -x && \
\
apk add --update --no-cache curl ca-certificates python py-pip jq && \
chmod +x /usr/local/bin/kubectl && \
chmod +x /usr/local/bin/kubectl.sh && \
chmod +x /usr/local/bin/aws-iam-authenticator && \
\
# Create non-root user (with a randomly chosen UID/GUI).
adduser kubectl -Du 2342 && \
\
# Install AWS CLI
pip install --upgrade awscli && \
# Basic check it works.
aws --version && kubectl version --client
USER kubectl
ENTRYPOINT [ "/usr/local/bin/kubectl.sh" ]