Search code examples
dockerboot2dockergcloud

Is it possible to install gcloud (Google cloud sdk) on boot2docker?


I'm trying to follow the instructions here to install google cloud sdk on my boot2docker environment without success.

Is the boot2docker is a limited linux? what is missing?
The error I get is:

(23) Failed writing body

Solution

  • Is the boot2docker is a limited linux?

    Yes, boot2docker is based on the Tiny Core distro, and has the following limitations:

    • Only C:\Users or /Users is mounted
    • symlinks are not supported.

    If gcloud needs to access to another path or uses symlink, that would fail.

    In general, boot2docker is there to host a docker dameon, and allows you to declare the installation of programs in containers.

    See for example blacklabelops/gcloud which includes the latest Google Cloud SDK along with all modules (as defined in its Dockerfile).

    You would execute gcloud commands by running that container, not by installing gcloud directly on your boot2docker instance.
    For instance:

    docker run -it --rm \
        -e "GCLOUD_ACCOUNT=$(base64 auth.json)" \
        -e "GCLOUD_ACCOUNT_EMAIL=useraccount@developer.gserviceaccount.com" \
        -e "CLOUDSDK_CORE_PROJECT=example-project" \
        -e "CLOUDSDK_COMPUTE_ZONE=europe-west1-b" \
        -e "CLOUDSDK_COMPUTE_REGION=europe-west1" \
        blacklabelops/gcloud \
        gcloud compute instances list