Skip to content

Instantly share code, notes, and snippets.

@mahmoud-samy
Last active September 4, 2018 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahmoud-samy/e67f141e8b5d553de68a58a30a432ed2 to your computer and use it in GitHub Desktop.
Save mahmoud-samy/e67f141e8b5d553de68a58a30a432ed2 to your computer and use it in GitHub Desktop.
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' ]
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/
#!/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