As a Developer (Client, Capgemini, Third Party, anyone on the Web) I want to be able to download a single executable so I will be able to run it without an installation process (run the executable directly from the “Downloads” directory if necessary) and have all the CLIs for Azure, AWS & GCloud available.
This solution uses a Dockerfile to create an image with all the required tools ready to use.
The following toolkits are included in the solution:
-
AWS
-
Azure
-
GCloud
-
Kubectl
-
Terraform
-
GitHub
-
Firebase CLI
Plus (+) other tools like unzip
, git
, wget
, java
& python
-
Build the image
docker build -t hangar -f ./setup/Dockerfile .
-
Execute a command inside the image
docker run --rm -it hangar gcloud auth login
or open an interactive shelldocker run --rm -it hangar bash
Warning
|
The container is stateless — all the information (credentials, configurations, etc.) created inside the session will be lost at the end of the lifecycle of the container. |
Tip
|
If you want to have persistence between executions or map the configuration files from your local host check the next section for mapping volumes. |
Important
|
Before mounting the volumes make sure all the folders exist, Rancher will not create them by default. |
docker run --rm -it -v /Users/$env:UserName/AppData/Roaming/gcloud:/root/.config/gcloud -v /Users/$env:UserName/AppData/Roaming/configstore:/root/.config/configstore -v /Users/$env:UserName/.aws:/root/.aws -v /Users/$env:UserName/.azure:/root/.azure -v /Users/$env:UserName/.kube:/root/.kube -v "/Users/$env:UserName/AppData/Roaming/GitHub CLI:/root/.config/gh" -v /Users/$env:UserName/.ssh:/root/.ssh -v /Users/$env:UserName/hangar_workspace:/scripts/workspace -v /Users/$env:UserName/.gitconfig:/root/.gitconfig hangar bash
docker run --rm -it -v C:\Users\$env:UserName\AppData\Roaming\gcloud\:/root/.config/gcloud -v C:\Users\$env:UserName\AppData\Roaming\configstore\:/root/.config/configstore -v C:\Users\$env:UserName\.aws:/root/.aws -v C:\Users\$env:UserName\.azure:/root/.azure -v C:\Users\$env:UserName\.kube:/root/.kube -v "C:\Users\$env:UserName\AppData\Roaming\GitHub CLI:/root/.config/gh" -v C:\Users\$env:UserName\.ssh:/root/.ssh -v C:\Users\$env:UserName\hangar_workspace:/scripts/workspace -v C:\Users\$env:UserName\.gitconfig:/root/.gitconfig hangar bash
mkdir -p /Users/$env:UserName/AppData/Roaming/gcloud
mkdir -p /Users/$env:UserName/AppData/Roaming/configstore
mkdir -p /Users/$env:UserName/.aws
mkdir -p /Users/$env:UserName/.azure:/root/.azure
mkdir -p /Users/$env:UserName/.kube
mkdir -p "/Users/$env:UserName/AppData/Roaming/GitHub CLI"
mkdir -p /Users/$env:UserName/.ssh
mkdir -p /Users/$env:UserName/hangar_workspace
docker run --rm -it -v ~/.config/gcloud:/root/.config/gcloud -v ~/.aws:/root/.aws -v ~/.azure:/root/.azure -v ~/.kube:/root/.kube -v ~/.config/gh:/root/.config/gh -v ~/.ssh:/root/.ssh -v ~/hangar_workspace:/scripts/workspace -v ~/.config/configstore:/root/.config/configstore -v ~/.gitconfig:/root/.gitconfig hangar bash
Tool | Windows | Linux | Container |
---|---|---|---|
GCloud CLI |
/Users/$env:UserName/AppData/Roaming/gcloud |
~/.config/gcloud |
/root/.config/gcloud |
AWS CLI |
/Users/$env:UserName/.aws |
~/.aws |
/root/.aws |
Azure CLI |
/Users/$env:UserName/.azure |
~/.azure |
/root/.azure |
Kubectl CLI |
/Users/$env:UserName/.kube |
~/.kube |
/root/.kube |
GitHub CLI |
/Users/$env:UserName/AppData/Roaming/GitHub CLI |
~/.config/gh |
/root/.config/gh |
Firebase CLI |
/Users/$env:UserName/AppData/Roaming/configstore |
~/.config/configstore |
/root/.config/configstore |
SSH Keys |
/Users/$env:UserName/.ssh |
~/.ssh |
/root/.ssh |