Container Tips and Tricks
The following are useful tricks for containers.
Tools Containers
It is often useful to put tools like gcloud
, aws
, and others in containers and use the containers in place of installing programs directly on the computer. This makes the commands more portable, but also make it easier to upgrade and rebuild should something go wrong.
First, install docker-desktop for your give OS, or some other container runtime.
Second, create a script like the following and put it somewhere it can be loaded.
|
|
Third, create a wrapper for the function you want. For example, the AWS CLI.
|
|
Finally, build / cache the needed CLI tool as a local container.
|
|
For bonus points you can setup a nightly CI pipeline to build containers like this and push to public or private image repo. But I leave that as an exercise for the audience.