content: FROM gitpod/workspace-full
  
  USER root
  
  ### cloud_sql_proxy ###
  ARG CLOUD_SQL_PROXY=/usr/local/bin/cloud_sql_proxy
  RUN curl -fsSL https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 > $CLOUD_SQL_PROXY \
      && chmod +x $CLOUD_SQL_PROXY
  
  ### Docker client ###
  RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
      # 'cosmic' not supported
      && add-apt-repository -yu "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" \
      && apt-get install -yq docker-ce-cli=5:18.09.0~3-0~ubuntu-bionic \
      && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
  
  ### Helm ###
  RUN curl -fsSL https://get.helm.sh/helm-v3.0.1-linux-amd64.tar.gz \
      | tar -xzvC /usr/local/bin --strip-components=1 \
      && helm completion bash > /usr/share/bash-completion/completions/helm
  
  ### kubernetes ###
  RUN mkdir -p /usr/local/kubernetes/ && \
      curl -fsSL https://github.com/kubernetes/kubernetes/releases/download/v1.16.2/kubernetes.tar.gz \ 
      | tar -xzvC /usr/local/kubernetes/ --strip-components=1 && \
      KUBERNETES_SKIP_CONFIRM=true /usr/local/kubernetes/cluster/get-kube-binaries.sh && \
      chown gitpod:gitpod -R /usr/local/kubernetes
  ENV PATH=$PATH:/usr/local/kubernetes/cluster/:/usr/local/kubernetes/client/bin/
  
  RUN curl -o /usr/bin/kubectx https://raw.githubusercontent.com/ahmetb/kubectx/master/kubectx && chmod +x /usr/bin/kubectx \
   && curl -o /usr/bin/kubens  https://raw.githubusercontent.com/ahmetb/kubectx/master/kubens  && chmod +x /usr/bin/kubens
  
  ### MySQL client ###
  RUN apt-get update && apt-get install -yq \
      mysql-client  \
      && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
  
  # yq - jq for YAML files
  RUN cd /usr/bin && curl -L https://github.com/mikefarah/yq/releases/download/2.4.0/yq_linux_amd64 > yq && chmod +x yq
  
  ### Certbot
  RUN apt-get update \
      && apt-get install -yq certbot python3-certbot-dns-google \
      && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
  
  USER gitpod
  
  ### Google Cloud ###
  # not installed via repository as then 'docker-credential-gcr' is not available
  ARG GCS_DIR=/opt/google-cloud-sdk
  ENV PATH=$GCS_DIR/bin:$PATH
  RUN sudo chown gitpod: /opt \
      && mkdir $GCS_DIR \
      && curl -fsSL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-245.0.0-linux-x86_64.tar.gz \
      | tar -xzvC /opt \
      && /opt/google-cloud-sdk/install.sh --quiet --usage-reporting=false --bash-completion=true \
      --additional-components docker-credential-gcr alpha beta \
      # needed for access to our private registries
      && docker-credential-gcr configure-docker
  