Skip to content

Voyz/gsutil_wrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gsutil_wrap

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.

Usage

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.

Key concepts

Authentication

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.

How does it work?

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.

Motivation

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.

License

See LICENSE

Built by Voy

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: hello@voyzan.com

Or if you'd just want to give something back, I've got a Buy Me A Coffee account:

Buy Me A Coffee

Thanks and have an awesome day 👋

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published