2020-05-15 07:49:13 +02:00
|
|
|
# Run awscli in a container and list s3 buckets
|
|
|
|
#
|
|
|
|
# docker run --rm -it \
|
|
|
|
# --name awscli \
|
|
|
|
# jess/awscli \
|
|
|
|
# s3 ls
|
|
|
|
#
|
|
|
|
|
2015-07-27 06:46:34 +02:00
|
|
|
FROM alpine:latest
|
2017-03-09 19:14:37 +01:00
|
|
|
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
|
2014-10-09 19:38:11 +02:00
|
|
|
|
2016-06-06 05:40:20 +02:00
|
|
|
RUN apk --no-cache add \
|
2015-07-27 06:46:34 +02:00
|
|
|
ca-certificates \
|
|
|
|
groff \
|
2015-10-01 01:47:19 +02:00
|
|
|
less \
|
2020-05-15 07:49:13 +02:00
|
|
|
python3 \
|
|
|
|
&& pip3 install awscli \
|
2015-07-27 07:40:32 +02:00
|
|
|
&& mkdir -p /root/.aws \
|
|
|
|
&& { \
|
|
|
|
echo '[default]'; \
|
|
|
|
echo 'output = json'; \
|
2016-04-03 07:33:44 +02:00
|
|
|
echo 'region = $AWS_DEFAULT_REGION'; \
|
2015-07-27 07:40:32 +02:00
|
|
|
echo 'aws_access_key_id = $AMAZON_ACCESS_KEY_ID'; \
|
|
|
|
echo 'aws_secret_access_key = $AMAZON_SECRET_ACCESS_KEY'; \
|
|
|
|
} > /root/.aws/config
|
2014-10-09 20:39:37 +02:00
|
|
|
|
2014-10-09 19:38:11 +02:00
|
|
|
ENTRYPOINT [ "aws" ]
|