Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mengjiann/ed7de455598640800e01fbd3c99c7250 to your computer and use it in GitHub Desktop.
Save mengjiann/ed7de455598640800e01fbd3c99c7250 to your computer and use it in GitHub Desktop.
Dockerfile for awscli with K8S deployment
FROM python:2.7
ENV AWS_DEFAULT_REGION='[your region]'
ENV AWS_ACCESS_KEY_ID='[your access key id]'
ENV AWS_SECRET_ACCESS_KEY='[your secret]'
RUN pip install awscli
CMD /bin/bash
# Generate docker image
docker build -f ./Dockerfile -t my/awscli:latest .
# Run awscli in kubernetes.
kubectl run -i -t awscli --image=my/awscli --image-pull-policy=Never --rm=true -- bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment