Last active
May 28, 2020 00:26
-
-
Save tristanmorgan/c1952c885b8dd9a307edc7086af7e0ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:latest | |
LABEL maintainer="Tristan Morgan <[email protected]>" | |
LABEL Description="AWS-CLI in a minimal container" | |
ARG AWS_CLI_VERSION=1.14.42 | |
RUN apk add --no-cache python3 groff \ | |
&& python3 -m pip install wheel --upgrade pip \ | |
&& python3 -m pip install awscli==$AWS_CLI_VERSION \ | |
&& rm -rf /root/.cache | |
ENV PAGER=more | |
WORKDIR /work | |
ENTRYPOINT ["aws"] | |
# docker build --pull --build-arg AWS_CLI_VERSION=$AWS_CLI_VERSION -t awscli:latest -t awscli:$AWS_CLI_VERSION . | |
# alias aws='docker run --rm -v $(pwd):/work -v ${HOME}/.aws/:/root/.aws/ -e AWS_DEFAULT_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN awscli' | |
# complete -C 'docker run --rm --entrypoint /usr/bin/aws_completer -e COMP_LINE -e COMP_POINT awscli' aws |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Putting the AWS CLI inside a container as way of isolating versions. about the only thing is only the current working directory is accessible for things like S3 uploads through the alias I use and , well I like to use environment variables for the access keys rather than a plain text file.