anchor.diff:          rm -rfv /var/cache/apk/*
   
   # Google cloud work (copied from https://github.com/GoogleCloudPlatform/cloud-sdk-docker/blob/master/alpine/Dockerfile )
  -RUN     wget -q ${GCLOUD_SDK_URL} && \
  -        tar xzf ${GCLOUD_FILE_NAME} && \
  -        rm ${GCLOUD_FILE_NAME} && \
  +RUN     wget -q -O gcloud.tgz ${GCLOUD_SDK_URL} && \
  +        echo "${GCLOUD_SHA256}  gcloud.tgz" | sha256sum -c - && \
  +        tar xzf gcloud.tgz && \
  +        rm gcloud.tgz && \
           ln -s /lib /lib64 && \
           gcloud config set core/disable_usage_reporting true && \
           gcloud config set component_manager/disable_update_check true && \
  
positive.code: MAINTAINER Michael Venezia <mvenezia@gmail.com>
  
  ENV     TERRAFORM_VERSION=0.8.6
  ENV     TF_COREOSBOX_VERSION=v0.0.3
  ENV     TF_DISTROIMAGE_VERSION=v0.0.1
  ENV     TF_PROVIDEREXECUTE_VERSION=v0.0.4
  
  ENV     GCLOUD_SDK_VERSION=162.0.0
  ENV     GCLOUD_FILE_NAME=google-cloud-sdk-${GCLOUD_SDK_VERSION}-linux-x86_64.tar.gz
  ENV     GCLOUD_SDK_URL=https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/${GCLOUD_FILE_NAME}
  ENV     CLOUDSDK_PYTHON_SITEPACKAGES 1
  # google cloud kubectl is superceeded by downloaded kubectl
  ENV     PATH $PATH:/google-cloud-sdk/bin
  
  ENV     ETCD_VERSION=v3.2.5
  ENV     ETCDCTL_API=3
  
  ENV     K8S_VERSION=v1.8.1
  ENV     K8S_HELM_VERSION=v2.7.0
  
  ENV     K8S_VERSION_1_5=v1.5.8
  ENV     K8S_VERSION_1_6=v1.6.11
  ENV     K8S_VERSION_1_7=v1.7.8
  ENV     K8S_VERSION_1_8=v1.8.2
  
  ENV     K8S_HELM_VERSION_1_5=v2.3.1
  ENV     K8S_HELM_VERSION_1_6=v2.5.1
  ENV     K8S_HELM_VERSION_1_7=v2.6.2
  ENV     K8S_HELM_VERSION_1_8=v2.7.0
  
  #Latest version of tools
  ENV     LATEST=v1.8
  ENV     K8S_VERSION_LATEST=$K8S_VERSION_1_8
  ENV     K8S_HELM_VERSION_LATEST=$K8S_HELM_VERSION_1_8
  
negative.code: ENV     APP_REGISTRY_URL=https://github.com/app-registry/appr-helm-plugin/releases/download/${APP_REGISTRY_PLUGIN_RELEASE}/helm-registry_linux.tar.gz
  
  # Alpine
  ADD     build/alpine-builds /alpine-builds
  
  ENV     APK_PACKAGES="bash ca-certificates openssl openssh python py-openssl py-pip py-cryptography py-cffi zip unzip wget util-linux bind-tools"
  ENV     APK_DEV_PACKAGES="gcc g++ git make libffi-dev linux-headers musl-dev libc-dev openssl-dev python-dev unzip mkinitfs kmod mtools squashfs-tools"
  
  RUN     apk add --update --no-cache ${APK_PACKAGES} ${APK_DEV_PACKAGES} && \
          /alpine-builds/build-docker.sh && \
          rm -rf /alpine-builds
  
  # Terraform
  RUN     wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
          echo "${TF_SHA256}  terraform_${TERRAFORM_VERSION}_linux_amd64.zip" | sha256sum -c - && \
          unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
          rm terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
          mv terraform /usr/bin/
  
  # Adding Terraform Provider Execute addon
  RUN     wget -q -O tf-prov.tgz https://github.com/samsung-cnct/terraform-provider-execute/releases/download/${TF_PROVIDEREXECUTE_VERSION}/terraform-provider-execute_linux_amd64.tar.gz && \
          echo "${TF_PROVIDEREXECUTE_SHA256}  tf-prov.tgz" | sha256sum -c - && \
          tar -zxvf tf-prov.tgz && \
          rm tf-prov.tgz && \
          mv terraform-provider-execute /usr/bin/
  
  # Adding Terraform CoreOS Box addon
  RUN     wget -q -O tf-coreos.tgz https://github.com/samsung-cnct/terraform-provider-coreosbox/releases/download/${TF_COREOSBOX_VERSION}/terraform-provider-coreosbox_linux_amd64.tar.gz && \
          echo "${TF_COREOSBOX_SHA256}  tf-coreos.tgz" | sha256sum -c - && \
          tar -zxvf tf-coreos.tgz && \
          rm tf-coreos.tgz && \
          mv terraform-provider-coreosbox /usr/bin/
  
  # Adding Terraform Distro Image Selector addon
  RUN     wget -q -O tf-distroimage.tgz https://github.com/samsung-cnct/terraform-provider-distroimage/releases/download/${TF_DISTROIMAGE_VERSION}/terraform-provider-distroimage_linux_amd64.tar.gz && \
          echo "${TF_DISTROIMAGE_SHA256}  tf-distroimage.tgz" | sha256sum -c - && \
          tar -zxvf tf-distroimage.tgz && \
          rm tf-distroimage.tgz && \
          mv terraform-provider-distro /usr/bin/
  
  # Etcd
  RUN     wget -q -O etcd.tgz https://github.com/coreos/etcd/releases/download//${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz && \
          echo "${ETCD_SHA256}  etcd.tgz" | sha256sum -c - && \
          tar -zxvf etcd.tgz && \
          cp etcd-${ETCD_VERSION}-linux-amd64/etcdctl /usr/local/bin && \
          rm -rf etcd-${ETCD_VERSION}-linux-amd64/ && \
          rm -f etcd.tgz
  
  # Creating path for helm and kubectl executables
  RUN     mkdir -p /opt/cnct/kubernetes/v1.6/bin \
                   /opt/cnct/kubernetes/v1.7/bin \
                   /opt/cnct/kubernetes/v1.8/bin \
                   /etc/helm/plugins
  
  # Kubectl
  RUN     wget -q https://storage.googleapis.com/kubernetes-release/release/v1.6.11/bin/linux/amd64/kubectl && \
          echo "${K8S_1_6_SHA256}  kubectl" | sha256sum -c - && \
          chmod a+x kubectl && \
          mv kubectl /opt/cnct/kubernetes/v1.6/bin
  RUN     wget -q https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION_1_7}/bin/linux/amd64/kubectl && \
          echo "${K8S_1_7_SHA256}  kubectl" | sha256sum -c - && \
          chmod a+x kubectl && \
          mv kubectl /opt/cnct/kubernetes/v1.7/bin
  RUN     wget -q https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION_1_8}/bin/linux/amd64/kubectl && \
          echo "${K8S_1_8_SHA256}  kubectl" | sha256sum -c - && \
          chmod a+x kubectl && \
          mv kubectl /opt/cnct/kubernetes/v1.8/bin
  
  
  # Helm
  RUN     wget -q -O helm-1-6.tgz http://storage.googleapis.com/kubernetes-helm/helm-v2.5.1-linux-amd64.tar.gz  && \
          echo "${HELM_2_5_SHA256}  helm-1-6.tgz" | sha256sum -c - && \
          tar -zxvf helm-1-6.tgz  && \
          mv linux-amd64/helm /opt/cnct/kubernetes/v1.6/bin/helm  && \
          rm -rf linux-amd64 helm-1-6.tgz
  RUN     wget -q -O helm-1-7.tgz http://storage.googleapis.com/kubernetes-helm/helm-${K8S_HELM_VERSION_1_7}-linux-amd64.tar.gz  && \
          echo "${HELM_2_6_SHA256}  helm-1-7.tgz" | sha256sum -c - && \
          tar -zxvf helm-1-7.tgz  && \
          mv linux-amd64/helm /opt/cnct/kubernetes/v1.7/bin/helm  && \
          rm -rf linux-amd64 helm-1-7.tgz
  RUN     wget -q -O helm-1-8.tgz http://storage.googleapis.com/kubernetes-helm/helm-${K8S_HELM_VERSION_1_8}-linux-amd64.tar.gz  && \
          echo "${HELM_2_7_SHA256}  helm-1-8.tgz" | sha256sum -c - && \
          tar -zxvf helm-1-8.tgz  && \
          mv linux-amd64/helm /opt/cnct/kubernetes/v1.8/bin/helm  && \
          rm -rf linux-amd64 helm-1-8.tgz
  
  RUN ln -s /opt/cnct/kubernetes/${LATEST} /opt/cnct/kubernetes/latest && \
           ln -s /opt/cnct/kubernetes/${LATEST}/bin/kubectl /usr/bin/ && \
  