Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Google Cloud SDK #15

Open
lorddaedra opened this issue Feb 16, 2018 · 3 comments
Open

Install Google Cloud SDK #15

lorddaedra opened this issue Feb 16, 2018 · 3 comments

Comments

@lorddaedra
Copy link

lorddaedra commented Feb 16, 2018

    \
    echo "Installing Google Cloud SDK..." && \
    apt-get update && \
    apt-get install -y --no-install-recommends apt-transport-https && \
    export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
    echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
    curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && \
    apt-get update && \
    apt-get install -y --no-install-recommends google-cloud-sdk && \
    rm -rf /var/lib/apt/lists/* && \
    gcloud config set core/disable_usage_reporting true && \
    gcloud config set component_manager/disable_update_check true && \
    \

Is will allow to use gsutil tools to sync local static folder with google cloud storage bucket (like s3 equivalent)

From:
https://cloud.google.com/storage/docs/gsutil_install#deb

@lorddaedra
Copy link
Author

@VladRassokhin

Hi, Vlad!

What do you think about it? it should be easy to maintain because of no version updates required, it will always install latest available version.

@lorddaedra
Copy link
Author

Another solution - use docker in docker (but it require to use --privileged flag) or mount docker.sock inside Agent. Next use https://github.com/GoogleCloudPlatform/cloud-sdk-docker/blob/master/Dockerfile (https://hub.docker.com/r/google/cloud-sdk/), but this solution can't be the best for security reasons...

@VladRassokhin
Copy link
Contributor

VladRassokhin commented Mar 25, 2018

I'm trying to keep agent image as tiny as possible (but failing sometimes)
Tried your snippet with on teamcity-agent, got next size results

docker history gcloud-agent
IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
ee7e6fab578a        4 seconds ago       /bin/sh -c echo "Installing Google Cloud S...   164MB "Add gloud"
5ae0b299f785        12 days ago         /bin/sh -c #(nop) COPY file:fa3ff1c6bbbc42...   111B  "Last in teamcity-agent:latest"

I'd say adding 164Mb is quite too expensive. I'd suggest to use docker-in-docker approach or building new image on top of jetbrains/teamcity-agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants