Various cloud utils (AWS CLI, aws-shell, awscli-login, Azure CLI, Terraform) in one Docker container.
- Available via Docker Hub (nothing sensitive in the container and makes pulling image and getting started more straight forward)
This is a base Python 3.7 base image that runs updates, sets timezone to Eastern, and installs the following:
- aws-cli
- session-manager-plugin
- aws-shell
- awscli-login
- azure cli
- terraform
- jq
- boto3
- botocore
- wheel
- groff
- vim
- zsh
Optionally installed (added at runtime based on config):
-
Clone this repository down and go into the directory:
git clone https://github.com/CU-CommunityApps/ct-cloud-utils-dockerized.git cd ct-cloud-utils-dockerized
-
Note: If you have an existing folder with files you want to use this with, copy the
docker-compose.yml
file to your folder and then proceed
This will set some environment variables and if you haven't already set up awscli-login
it will create a default config
-
Edit the
docker-compose.yml
file to set your preferences -
Bring a persistent container up:
docker-compose up --detach
-
Attach to a shell:
docker-compose exec cloud-utils configure-cloud-utils
-
Note: Last 2 steps can be called together:
docker-compose up --detach && docker-compose exec cloud-utils configure-cloud-utils
-
You should now be able to run commands from any of the installed utilities (including
aws
,aws login
,aws-shell
,azure
, andterraform
) -
Note: The container will remain running unless you manually stop it (this is useful if you want to return to a session with your prior setup, bash history, etc.) - reaatch to it with the following command:
docker-compose exec cloud-utils bash
-
Stopping the container (after exiting it):
docker-compose down
-
Check if you have any running containers:
docker-compose ps
-
Alternative command to bring up a container that removes itself on exit:
docker-compose run --rm cloud-utils configure-cloud-utils
-
Note: If you want your container to persist, remove the
--rm
flag from the commands below -
This command will mount your current directory as the working directory in the container:
docker run --rm -it \ -e SETUP_AWSCLI_LOGIN=true \ -e DUO_FACTOR="auto" \ -e NETID="" \ -e SETUP_OHMYZSH=true \ -e SETUP_FX=false \ -v $HOME/.aws:/root/.aws \ -v $HOME/.aws-login:/root/.aws-login \ -v $PWD:/mounted-home \ -w /mounted-home \ mikesprague/cloud-utils
-
You can also alias the same command in your bash/zsh profile (bash via
~/.profile
or~/.bashrc
or Zsh via~/.zshrc
) to simplify reuse:alias cloud-utils="docker run --rm -it \ -e SETUP_AWSCLI_LOGIN=true \ -e DUO_FACTOR="auto" \ -e NETID="" \ -e SETUP_OHMYZSH=true \ -e SETUP_FX=false \ -v $HOME/.aws:/root/.aws \ -v $HOME/.aws-login:/root/.aws-login \ -v $PWD:/mounted-home \ -w /mounted-home \ mikesprague/cloud-utils"
-
☝️ The above snippet will make the command
cloud-utils
available in your shell and start the container in whatever directory you run thecloud-utils
command