gsutil_wrap is a Docker image used to isolate the Google Cloud's gsutil standalone tool from the google/cloud-sdk image.
Its primary use is to provide gsutil functionality in a lightweight fashion, for instance in the Container Optimised OS.
gsutil_wrap is available as public Docker image called:
voyz/gsutil_wrap
As such, it can be used as follows:
docker run -v /host/path:/container/path --entrypoint gsutil voyz/gsutil_wrap cp gs://bucket/path /container/path
This can be used in the startup-script of your GCP instance to download data from your Storage bucket upon instance boot. This is particularly useful when using Container Optimised OS.
Designed to work on a GCP Compute Engine instance, gsutil_wrap will attempt to use the default service account credentials available on the instance it is run from to authenticate with the GCP Storage.
When run as intended (see Usage), Docker will mount a volume binding a host directory to a container directory running the gsutil_wrap image. Then gsutil is used to download files to into that mounted volume, which will now become available in the host directory too.
Credit to Guillaume Blaquiere for outlining this method of downloading files using a Docker image.
Based on suggestions from this StackOverflow question, I attempted to find a solution that wouldn't require large google/cloud-sdk image (2.41GB at the time of writing this) being used to fetch small files from the Google Cloud Storage.
gsutil_wrap image weighs 220MB decompressed and takes only a few seconds to pull.
See LICENSE
Hi! Thanks for checking out and using this library. If you are interested in discussing your project, requiring mentorship, considering hiring me, or just wanna chat - I'm happy to talk.
You can send me an email to get in touch: [email protected]
Or if you'd just want to give something back, I've got a Buy Me A Coffee account:
Thanks and have an awesome day 👋