Last active
December 29, 2017 08:34
-
-
Save rhoboro/e27d24fa782a69865537a7a78e1c4823 to your computer and use it in GitHub Desktop.
サービスアカウントgsutilを使う
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put service-account-key to ./credentials.json | |
# docker build -t image/gsutil:0.1 . | |
# docker run --rm -it image/gsutil:0.1 ls gs://your_backet | |
FROM alpine:3.7 | |
RUN apk update && apk add python \ | |
&& wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-180.0.0-linux-x86_64.tar.gz \ | |
&& tar zxvf google-cloud-sdk-180.0.0-linux-x86_64.tar.gz \ | |
&& ./google-cloud-sdk/install.sh \ | |
&& google-cloud-sdk/bin/gcloud config set component_manager/disable_update_check true | |
COPY credentials.json ./credentials.json | |
RUN google-cloud-sdk/bin/gcloud auth activate-service-account --key-file credentials.json --project my-project | |
ENTRYPOINT ["google-cloud-sdk/bin/gsutil"] | |
CMD ["ls", "gs://mybacket"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment