Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refs #35: Add aws-iam-authenticator #36

Merged
merged 1 commit into from
Nov 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Dockerfile-aws
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ FROM alpine:3.9 as builder
RUN set -x \
&& apk add --no-cache \
bc \
curl \
gcc \
git \
libffi-dev \
make \
musl-dev \
Expand Down Expand Up @@ -43,6 +45,21 @@ RUN set -x \
&& find /usr/lib/ -name '*.pyc' -print0 | xargs -0 -n1 rm -rf \
&& aws --version 2>&1 | grep -E '^aws-cli/[.0-9]+'

RUN set -x \
&& git clone https://github.com/kubernetes-sigs/aws-iam-authenticator /tmp/aws-iam-authenticator \
&& cd /tmp/aws-iam-authenticator \
&& IAM_AUTH_VERSION="$( git tag --sort=-creatordate \
| grep -E 'v[0-9]+\.[0-9]+\.[0-9]+$' \
| head -1 \
| sed 's/^v//g' \
)" \
&& curl -sS -L -b cookies.txt -c cookies.txt \
-o /usr/bin/aws-iam-authenticator \
-H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36" \
"https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${IAM_AUTH_VERSION}/aws-iam-authenticator_${IAM_AUTH_VERSION}_linux_amd64" \
&& chmod +x /usr/bin/aws-iam-authenticator \
&& aws-iam-authenticator version | grep "\"${IAM_AUTH_VERSION}\""


FROM alpine:3.9 as production
LABEL \
Expand All @@ -53,6 +70,7 @@ COPY --from=builder /usr/lib/python3.6/site-packages/ /usr/lib/python3.6/site-pa
COPY --from=builder /usr/bin/ansible /usr/bin/ansible
COPY --from=builder /usr/bin/ansible-connection /usr/bin/ansible-connection
COPY --from=builder /usr/bin/aws /usr/bin/aws
COPY --from=builder /usr/bin/aws-iam-authenticator /usr/bin/aws-iam-authenticator

ENV \
MY_USER=ansible \
Expand Down
19 changes: 18 additions & 1 deletion Dockerfile-awshelm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM alpine:3.9 as builder
RUN set -x \
&& apk add --no-cache \
bc \
curl \
gcc \
git \
libffi-dev \
Expand Down Expand Up @@ -44,13 +45,27 @@ RUN set -x \
&& find /usr/lib/ -name '*.pyc' -print0 | xargs -0 -n1 rm -rf \
&& aws --version 2>&1 | grep -E '^aws-cli/[.0-9]+'

RUN set -x \
&& git clone https://github.com/kubernetes-sigs/aws-iam-authenticator /tmp/aws-iam-authenticator \
&& cd /tmp/aws-iam-authenticator \
&& IAM_AUTH_VERSION="$( git tag --sort=-creatordate \
| grep -E 'v[0-9]+\.[0-9]+\.[0-9]+$' \
| head -1 \
| sed 's/^v//g' \
)" \
&& curl -sS -L -b cookies.txt -c cookies.txt \
-o /usr/bin/aws-iam-authenticator \
-H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36" \
"https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${IAM_AUTH_VERSION}/aws-iam-authenticator_${IAM_AUTH_VERSION}_linux_amd64" \
&& chmod +x /usr/bin/aws-iam-authenticator \
&& aws-iam-authenticator version | grep "\"${IAM_AUTH_VERSION}\""

RUN set -x \
&& pip3 install --no-cache-dir --no-compile openshift \
&& find /usr/lib/ -name '__pycache__' -print0 | xargs -0 -n1 rm -rf \
&& find /usr/lib/ -name '*.pyc' -print0 | xargs -0 -n1 rm -rf

RUN set -x \
&& apk add --no-cache curl \
&& curl -sS -L -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 \
&& chmod +x /usr/bin/kubectl \
Expand All @@ -70,6 +85,7 @@ RUN set -x \
&& chmod +x /usr/bin/helm \
&& /usr/bin/helm version | grep -E "${HELM}" | grep -E "${version}"


FROM alpine:3.9 as production
LABEL \
maintainer="cytopia <cytopia@everythingcli.org>" \
Expand All @@ -79,6 +95,7 @@ COPY --from=builder /usr/lib/python3.6/site-packages/ /usr/lib/python3.6/site-pa
COPY --from=builder /usr/bin/ansible /usr/bin/ansible
COPY --from=builder /usr/bin/ansible-connection /usr/bin/ansible-connection
COPY --from=builder /usr/bin/aws /usr/bin/aws
COPY --from=builder /usr/bin/aws-iam-authenticator /usr/bin/aws-iam-authenticator
COPY --from=builder /usr/bin/kubectl /usr/bin/kubectl
COPY --from=builder /usr/bin/helm /usr/bin/helm

Expand Down
19 changes: 18 additions & 1 deletion Dockerfile-awsk8s
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ FROM alpine:3.9 as builder
RUN set -x \
&& apk add --no-cache \
bc \
curl \
gcc \
git \
libffi-dev \
make \
musl-dev \
Expand Down Expand Up @@ -43,13 +45,27 @@ RUN set -x \
&& find /usr/lib/ -name '*.pyc' -print0 | xargs -0 -n1 rm -rf \
&& aws --version 2>&1 | grep -E '^aws-cli/[.0-9]+'

RUN set -x \
&& git clone https://github.com/kubernetes-sigs/aws-iam-authenticator /tmp/aws-iam-authenticator \
&& cd /tmp/aws-iam-authenticator \
&& IAM_AUTH_VERSION="$( git tag --sort=-creatordate \
| grep -E 'v[0-9]+\.[0-9]+\.[0-9]+$' \
| head -1 \
| sed 's/^v//g' \
)" \
&& curl -sS -L -b cookies.txt -c cookies.txt \
-o /usr/bin/aws-iam-authenticator \
-H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36" \
"https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${IAM_AUTH_VERSION}/aws-iam-authenticator_${IAM_AUTH_VERSION}_linux_amd64" \
&& chmod +x /usr/bin/aws-iam-authenticator \
&& aws-iam-authenticator version | grep "\"${IAM_AUTH_VERSION}\""

RUN set -x \
&& pip3 install --no-cache-dir --no-compile openshift \
&& find /usr/lib/ -name '__pycache__' -print0 | xargs -0 -n1 rm -rf \
&& find /usr/lib/ -name '*.pyc' -print0 | xargs -0 -n1 rm -rf

RUN set -x \
&& apk add --no-cache curl \
&& curl -sS -L -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 \
&& chmod +x /usr/bin/kubectl \
Expand All @@ -65,6 +81,7 @@ COPY --from=builder /usr/lib/python3.6/site-packages/ /usr/lib/python3.6/site-pa
COPY --from=builder /usr/bin/ansible /usr/bin/ansible
COPY --from=builder /usr/bin/ansible-connection /usr/bin/ansible-connection
COPY --from=builder /usr/bin/aws /usr/bin/aws
COPY --from=builder /usr/bin/aws-iam-authenticator /usr/bin/aws-iam-authenticator
COPY --from=builder /usr/bin/kubectl /usr/bin/kubectl

ENV \
Expand Down
18 changes: 17 additions & 1 deletion Dockerfile-awskops
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM alpine:3.9 as builder
RUN set -x \
&& apk add --no-cache \
bc \
curl \
gcc \
git \
libffi-dev \
Expand Down Expand Up @@ -44,13 +45,27 @@ RUN set -x \
&& find /usr/lib/ -name '*.pyc' -print0 | xargs -0 -n1 rm -rf \
&& aws --version 2>&1 | grep -E '^aws-cli/[.0-9]+'

RUN set -x \
&& git clone https://github.com/kubernetes-sigs/aws-iam-authenticator /tmp/aws-iam-authenticator \
&& cd /tmp/aws-iam-authenticator \
&& IAM_AUTH_VERSION="$( git tag --sort=-creatordate \
| grep -E 'v[0-9]+\.[0-9]+\.[0-9]+$' \
| head -1 \
| sed 's/^v//g' \
)" \
&& curl -sS -L -b cookies.txt -c cookies.txt \
-o /usr/bin/aws-iam-authenticator \
-H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36" \
"https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${IAM_AUTH_VERSION}/aws-iam-authenticator_${IAM_AUTH_VERSION}_linux_amd64" \
&& chmod +x /usr/bin/aws-iam-authenticator \
&& aws-iam-authenticator version | grep "\"${IAM_AUTH_VERSION}\""

RUN set -x \
&& pip3 install --no-cache-dir --no-compile openshift \
&& find /usr/lib/ -name '__pycache__' -print0 | xargs -0 -n1 rm -rf \
&& find /usr/lib/ -name '*.pyc' -print0 | xargs -0 -n1 rm -rf

RUN set -x \
&& apk add --no-cache curl \
&& curl -sS -L -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 \
&& chmod +x /usr/bin/kubectl \
Expand Down Expand Up @@ -78,6 +93,7 @@ COPY --from=builder /usr/lib/python3.6/site-packages/ /usr/lib/python3.6/site-pa
COPY --from=builder /usr/bin/ansible /usr/bin/ansible
COPY --from=builder /usr/bin/ansible-connection /usr/bin/ansible-connection
COPY --from=builder /usr/bin/aws /usr/bin/aws
COPY --from=builder /usr/bin/aws-iam-authenticator /usr/bin/aws-iam-authenticator
COPY --from=builder /usr/bin/kubectl /usr/bin/kubectl
COPY --from=builder /usr/bin/kops /usr/bin/kops

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The following table shows a quick overview. For more details see further down be
| tools | base | `dnspython`, `mitogen` | `bash`, `git`, `gpg`, `jq`, `ssh` |
| infra | tools | `docker`, `pexpect`, `psycopg2`, `pypsexec`, `pymongo`, `PyMySQL`, `smbprotocol` | - |
| azure | tools | `azure` | - |
| aws | tools | `awscli`, `botocore`, `boto`, `boto3` | `aws` |
| aws | tools | `awscli`, `botocore`, `boto`, `boto3` | `aws`, `aws-iam-authenticator` |
| awsk8s | aws | `openshift` | `kubectl` |
| awskops | awsk8s | - | `kops` |
| awshelm | awsk8s | - | `helm` |
Expand Down