How I run the AWS CLI in docker

I didn't want to download the AWS CLI client over and over, so I wrote a tiny wrapper script to run it in a docker container. I don't use it a lot as setting up shell completions is a pain, but it can be useful.
#!/usr/bin/env bash
rootdir="${HOME}/.config/aws-cli-root"
if [[ ! -d "${rootdir}" ]]; then
echo "${rootdir} does not exist"
exit 1
fi
# shellcheck disable=SC2068
docker run -it -v "${rootdir}":/root/.aws amazon/aws-cli $@
0 comments
Reply