Last active
September 4, 2018 15:53
-
-
Save mahmoud-samy/e67f141e8b5d553de68a58a30a432ed2 to your computer and use it in GitHub Desktop.
https://stackoverflow.com/posts/52152526 - trial 5
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
steps: | |
- name: gcr.io/cloud-builders/docker | |
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/ubuntu-gcloud', '.' ] | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['push', 'gcr.io/$PROJECT_ID/ubuntu-gcloud'] | |
- name: gcr.io/$PROJECT_ID/ubuntu-gcloud | |
args: [ 'bash', 'list-gce.sh' ] |
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
FROM ubuntu:16.04 | |
RUN apt-get -y update && \ | |
apt-get -y install gcc python2.7 python-dev python-setuptools wget ca-certificates \ | |
# These are necessary for add-apt-respository | |
software-properties-common python-software-properties && \ | |
# Install Git >2.0.1 | |
add-apt-repository ppa:git-core/ppa && \ | |
apt-get -y update && \ | |
apt-get -y install git && \ | |
# Setup Google Cloud SDK (latest) | |
mkdir -p /builder && \ | |
wget -qO- https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz | tar zxv -C /builder && \ | |
CLOUDSDK_PYTHON="python2.7" /builder/google-cloud-sdk/install.sh --usage-reporting=false \ | |
--bash-completion=false \ | |
--disable-installation-options && \ | |
# install crcmod: https://cloud.google.com/storage/docs/gsutil/addlhelp/CRC32CandInstallingcrcmod | |
easy_install -U pip && \ | |
pip install -U crcmod && \ | |
# Clean up | |
apt-get -y remove gcc python-dev python-setuptools wget && \ | |
rm -rf /var/lib/apt/lists/* && \ | |
rm -rf ~/.config/gcloud | |
# Adding the package path to local | |
ENV PATH $PATH:/builder/google-cloud-sdk/bin/ |
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
#!/bin/bash | |
gcloud --version | |
gcloud compute instances list > gce-list.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment