├── .dockerignore ├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── 1.11 ├── alpine │ ├── Dockerfile │ └── cloudbuild.yaml ├── slim │ ├── Dockerfile │ └── cloudbuild.yaml └── stretch │ ├── Dockerfile │ └── cloudbuild.yaml ├── 1.6 ├── jessie │ ├── Dockerfile │ └── cloudbuild.yaml └── slim │ ├── Dockerfile │ └── cloudbuild.yaml ├── 1.8 ├── jessie │ ├── Dockerfile │ └── cloudbuild.yaml └── slim │ ├── Dockerfile │ └── cloudbuild.yaml ├── 1.9 ├── jessie │ ├── Dockerfile │ └── cloudbuild.yaml └── slim │ ├── Dockerfile │ └── cloudbuild.yaml ├── CONTRIBUTING.md ├── LICENSE ├── README.md └── cloudbuild.yaml /.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Please read the CLA carefully before submitting your contribution to Mercari. 2 | Under any circumstances, by submitting your contribution, you are deemed to accept and agree to be bound by the terms and conditions of the CLA. 3 | 4 | https://www.mercari.com/cla/ 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # docker-appengine-go project generated files to ignore 2 | # if you want to ignore files created by your editor/tools, 3 | # please consider a global .gitignore https://help.github.com/articles/ignoring-files 4 | # please do not open a pull request to add something created by your editor or tools 5 | -------------------------------------------------------------------------------- /1.11/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker:18.06 as stage-static-docker 2 | 3 | FROM alpine:3.8 4 | LABEL maintainer "Mercari, Inc" 5 | 6 | ARG GOLANG_VERSION=1.11.1 7 | ARG GOLANG_DOWNLOAD_SHA256=2871270d8ff0c8c69f161aaae42f9f28739855ff5c5204752a8d92a1c9f63993 8 | ARG CLOUD_SDK_VERSION=223.0.0 9 | ENV GOPATH=/go \ 10 | PATH=/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:$PATH \ 11 | GOLANG_VERSION="$GOLANG_VERSION" \ 12 | GOLANG_DOWNLOAD_SHA256="$GOLANG_DOWNLOAD_SHA256" \ 13 | CLOUD_SDK_VERSION="$CLOUD_SDK_VERSION" 14 | 15 | COPY --from=stage-static-docker /usr/local/bin/docker /usr/local/bin/docker 16 | RUN set -eux && \ 17 | apk --no-cache add \ 18 | bash \ 19 | curl \ 20 | g++ \ 21 | gcc \ 22 | git \ 23 | libc6-compat \ 24 | make \ 25 | musl-dev \ 26 | openssh-client \ 27 | py-crcmod \ 28 | python && \ 29 | \ 30 | curl -sSL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-"$CLOUD_SDK_VERSION"-"$(uname | tr '[:upper:]' '[:lower:]')"-"$(uname -m)".tar.gz | tar -C /usr/lib -xzf - && \ 31 | gcloud config set core/disable_usage_reporting true && \ 32 | gcloud config set component_manager/disable_update_check true && \ 33 | gcloud config set metrics/environment github_docker_image && \ 34 | /usr/lib/google-cloud-sdk/install.sh --usage-reporting=false --command-completion=false --path-update=false --quiet --additional-components \ 35 | app-engine-go \ 36 | beta && \ 37 | \ 38 | curl -o go.tgz -sSL "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz" && \ 39 | echo "${GOLANG_DOWNLOAD_SHA256} *go.tgz" | sha256sum -c - && \ 40 | tar -C /usr/local -xzf go.tgz && \ 41 | rm go.tgz && \ 42 | mkdir -p ${GOPATH} 43 | 44 | VOLUME ["/root/.config"] 45 | -------------------------------------------------------------------------------- /1.11/alpine/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - name: 'gcr.io/cloud-builders/docker' 3 | args: 4 | - build 5 | - -t 6 | - gcr.io/$PROJECT_ID/appengine/go:1.11-alpine 7 | - . 8 | - name: 'gcr.io/cloud-builders/docker' 9 | args: 10 | - tag 11 | - gcr.io/$PROJECT_ID/appengine/go:1.11-alpine 12 | - gcr.io/$PROJECT_ID/appengine/go:alpine 13 | 14 | images: 15 | - gcr.io/$PROJECT_ID/appengine/go:1.11-alpine 16 | - gcr.io/$PROJECT_ID/appengine/go:alpine 17 | 18 | timeout: 600s 19 | -------------------------------------------------------------------------------- /1.11/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker:18.06 as stage-static-docker 2 | 3 | FROM debian:stretch 4 | LABEL maintainer "Mercari, Inc" 5 | 6 | ARG GOLANG_VERSION=1.11.1 7 | ARG GOLANG_DOWNLOAD_SHA256=2871270d8ff0c8c69f161aaae42f9f28739855ff5c5204752a8d92a1c9f63993 8 | ARG CLOUD_SDK_VERSION=223.0.0 9 | ENV GOPATH=/go \ 10 | PATH=/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:$PATH \ 11 | GOLANG_VERSION="$GOLANG_VERSION" \ 12 | GOLANG_DOWNLOAD_SHA256="$GOLANG_DOWNLOAD_SHA256" \ 13 | CLOUD_SDK_VERSION="$CLOUD_SDK_VERSION" 14 | 15 | COPY --from=stage-static-docker /usr/local/bin/docker /usr/local/bin/docker 16 | RUN set -eux && \ 17 | apt-get update && \ 18 | apt-get install -yqq --no-install-suggests --no-install-recommends \ 19 | curl \ 20 | gcc \ 21 | git \ 22 | libc6-dev \ 23 | make \ 24 | openssh-client \ 25 | python-dev \ 26 | python-pip \ 27 | python-setuptools \ 28 | unzip && \ 29 | rm -rf /var/lib/apt/lists/* && \ 30 | \ 31 | pip install -U crcmod && \ 32 | rm -rf $HOME/.cache/pip && \ 33 | \ 34 | curl -sSL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-"$CLOUD_SDK_VERSION"-"$(uname | tr '[:upper:]' '[:lower:]')"-"$(uname -m)".tar.gz | tar -C /usr/lib -xzf - && \ 35 | gcloud config set core/disable_usage_reporting true && \ 36 | gcloud config set component_manager/disable_update_check true && \ 37 | gcloud config set metrics/environment github_docker_image && \ 38 | /usr/lib/google-cloud-sdk/install.sh --usage-reporting=false --command-completion=false --path-update=false --quiet --additional-components \ 39 | app-engine-go \ 40 | beta && \ 41 | \ 42 | curl -o go.tgz -sSL "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz" && \ 43 | echo "${GOLANG_DOWNLOAD_SHA256} *go.tgz" | sha256sum -c - && \ 44 | tar -C /usr/local -xzf go.tgz && \ 45 | rm go.tgz && \ 46 | mkdir -p ${GOPATH} 47 | 48 | VOLUME ["/root/.config"] 49 | -------------------------------------------------------------------------------- /1.11/slim/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - name: 'gcr.io/cloud-builders/docker' 3 | args: 4 | - build 5 | - -t 6 | - gcr.io/$PROJECT_ID/appengine/go:1.11-slim 7 | - . 8 | - name: 'gcr.io/cloud-builders/docker' 9 | args: 10 | - tag 11 | - gcr.io/$PROJECT_ID/appengine/go:1.11-slim 12 | - gcr.io/$PROJECT_ID/appengine/go:slim 13 | 14 | images: 15 | - gcr.io/$PROJECT_ID/appengine/go:1.11-slim 16 | - gcr.io/$PROJECT_ID/appengine/go:slim 17 | 18 | timeout: 600s 19 | -------------------------------------------------------------------------------- /1.11/stretch/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker:18.06 as stage-static-docker 2 | 3 | FROM debian:stretch 4 | LABEL maintainer "Mercari, Inc" 5 | 6 | ARG GOLANG_VERSION=1.11.1 7 | ARG GOLANG_DOWNLOAD_SHA256=2871270d8ff0c8c69f161aaae42f9f28739855ff5c5204752a8d92a1c9f63993 8 | ARG CLOUD_SDK_VERSION=223.0.0 9 | ENV GOPATH=/go \ 10 | PATH=/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:$PATH \ 11 | GOLANG_VERSION="$GOLANG_VERSION" \ 12 | GOLANG_DOWNLOAD_SHA256="$GOLANG_DOWNLOAD_SHA256" \ 13 | CLOUD_SDK_VERSION="$CLOUD_SDK_VERSION" 14 | 15 | COPY --from=stage-static-docker /usr/local/bin/docker /usr/local/bin/docker 16 | RUN set -eux && \ 17 | apt-get update && \ 18 | apt-get install -yqq --no-install-suggests --no-install-recommends \ 19 | curl \ 20 | gcc \ 21 | git \ 22 | libc6-dev \ 23 | make \ 24 | openjdk-8-jdk-headless \ 25 | openssh-client \ 26 | python-dev \ 27 | python-pip \ 28 | python-setuptools \ 29 | unzip && \ 30 | rm -rf /var/lib/apt/lists/* && \ 31 | \ 32 | pip install -U crcmod && \ 33 | rm -rf $HOME/.cache/pip && \ 34 | \ 35 | curl -sSL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-"$CLOUD_SDK_VERSION"-"$(uname | tr '[:upper:]' '[:lower:]')"-"$(uname -m)".tar.gz | tar -C /usr/lib -xzf - && \ 36 | /usr/lib/google-cloud-sdk/install.sh --usage-reporting=false --command-completion=false --path-update=false --quiet --additional-components \ 37 | app-engine-go \ 38 | bq \ 39 | cbt \ 40 | bigtable \ 41 | cloud-datastore-emulator \ 42 | pubsub-emulator \ 43 | core \ 44 | cloud_sql_proxy \ 45 | emulator-reverse-proxy \ 46 | cloud-build-local \ 47 | docker-credential-gcr \ 48 | beta && \ 49 | gcloud config set core/disable_usage_reporting true && \ 50 | gcloud config set component_manager/disable_update_check true && \ 51 | gcloud config set metrics/environment github_docker_image && \ 52 | \ 53 | curl -o go.tgz -sSL "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz" && \ 54 | echo "${GOLANG_DOWNLOAD_SHA256} *go.tgz" | sha256sum -c - && \ 55 | tar -C /usr/local -xzf go.tgz && \ 56 | rm go.tgz && \ 57 | mkdir -p ${GOPATH} 58 | 59 | VOLUME ["/root/.config"] 60 | -------------------------------------------------------------------------------- /1.11/stretch/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - name: 'gcr.io/cloud-builders/docker' 3 | args: 4 | - build 5 | - -t 6 | - gcr.io/$PROJECT_ID/appengine/go:1.11-stretch 7 | - . 8 | - name: 'gcr.io/cloud-builders/docker' 9 | args: 10 | - tag 11 | - gcr.io/$PROJECT_ID/appengine/go:1.11-stretch 12 | - gcr.io/$PROJECT_ID/appengine/go:1.11 13 | - name: 'gcr.io/cloud-builders/docker' 14 | args: 15 | - tag 16 | - gcr.io/$PROJECT_ID/appengine/go:1.11-stretch 17 | - gcr.io/$PROJECT_ID/appengine/go:latest 18 | 19 | images: 20 | - gcr.io/$PROJECT_ID/appengine/go:1.11-stretch 21 | - gcr.io/$PROJECT_ID/appengine/go:1.11 22 | - gcr.io/$PROJECT_ID/appengine/go:latest 23 | 24 | timeout: 600s 25 | -------------------------------------------------------------------------------- /1.6/jessie/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | LABEL maintainer "Mercari, Inc" 3 | 4 | ENV GOPATH=/go \ 5 | PATH=/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:$PATH 6 | 7 | ARG APT_MIRROR=httpredir.debian.org 8 | ARG GOLANG_VERSION=1.6.4 9 | ARG GOLANG_DOWNLOAD_SHA256=b58bf5cede40b21812dfa031258db18fc39746cc0972bc26dae0393acc377aaf 10 | 11 | RUN sed -ri "s/(deb|httpredir).debian.org/${APT_MIRROR}/g" /etc/apt/sources.list && \ 12 | set -eux && \ 13 | apt-get update && \ 14 | apt-get install -yqq --no-install-suggests --no-install-recommends \ 15 | curl \ 16 | gcc \ 17 | git \ 18 | libc6-dev \ 19 | make \ 20 | openjdk-7-jdk \ 21 | openssh-client \ 22 | python-dev \ 23 | python-pip \ 24 | unzip && \ 25 | rm -rf /var/lib/apt/lists/* && \ 26 | \ 27 | pip install -U crcmod && \ 28 | rm -rf $HOME/.cache/pip && \ 29 | \ 30 | curl https://sdk.cloud.google.com | bash -s -- --disable-prompts --install-dir=/usr/lib && \ 31 | gcloud config set core/disable_usage_reporting true && \ 32 | gcloud config set component_manager/disable_update_check true && \ 33 | gcloud config set metrics/environment github_docker_image && \ 34 | \ 35 | gcloud components install \ 36 | app-engine-go \ 37 | beta \ 38 | cloud-datastore-emulator \ 39 | emulator-reverse-proxy \ 40 | pubsub-emulator && \ 41 | \ 42 | chmod +x \ 43 | /usr/lib/google-cloud-sdk/platform/google_appengine/goapp \ 44 | /usr/lib/google-cloud-sdk/platform/google_appengine/godoc \ 45 | /usr/lib/google-cloud-sdk/platform/google_appengine/gofmt \ 46 | /usr/lib/google-cloud-sdk/platform/google_appengine/appcfg.py \ 47 | /usr/lib/google-cloud-sdk/platform/google_appengine/backends_conversion.py \ 48 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkload_client.py \ 49 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkloader.py \ 50 | /usr/lib/google-cloud-sdk/platform/google_appengine/download_appstats.py \ 51 | /usr/lib/google-cloud-sdk/platform/google_appengine/endpointscfg.py && \ 52 | \ 53 | # patch for always use go1.6 runtime 54 | sed -i "s|goroots.GOROOTS\['go1'\])|goroots.GOROOTS\['go1.6'\])|g" $(which goapp) && \ 55 | \ 56 | curl -o go.tgz -sSL "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz" && \ 57 | echo "${GOLANG_DOWNLOAD_SHA256} *go.tgz" | sha256sum -c - && \ 58 | tar -C /usr/local -xzf go.tgz && \ 59 | rm go.tgz 60 | 61 | VOLUME ["/root/.config"] 62 | -------------------------------------------------------------------------------- /1.6/jessie/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - name: 'gcr.io/cloud-builders/docker' 3 | args: 4 | - build 5 | - -t 6 | - gcr.io/$PROJECT_ID/appengine/go:1.6-jessie 7 | - . 8 | - name: 'gcr.io/cloud-builders/docker' 9 | args: 10 | - tag 11 | - gcr.io/$PROJECT_ID/appengine/go:1.6-jessie 12 | - gcr.io/$PROJECT_ID/appengine/go:1.6 13 | 14 | images: 15 | - gcr.io/$PROJECT_ID/appengine/go:1.6-jessie 16 | - gcr.io/$PROJECT_ID/appengine/go:1.6 17 | 18 | timeout: 600s 19 | -------------------------------------------------------------------------------- /1.6/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie-slim 2 | LABEL maintainer "Mercari, Inc" 3 | 4 | ARG APT_MIRROR=httpredir.debian.org 5 | ARG GOLANG_VERSION=1.6.4 6 | ARG GOLANG_DOWNLOAD_SHA256=b58bf5cede40b21812dfa031258db18fc39746cc0972bc26dae0393acc377aaf 7 | 8 | ENV GOPATH=/go \ 9 | PATH=/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:$PATH 10 | 11 | RUN sed -ri "s/(deb|httpredir).debian.org/${APT_MIRROR}/g" /etc/apt/sources.list && \ 12 | set -eux && \ 13 | apt-get update && \ 14 | apt-get install -yqq --no-install-suggests --no-install-recommends \ 15 | curl \ 16 | gcc \ 17 | git \ 18 | libc6-dev \ 19 | make \ 20 | openssh-client \ 21 | python-dev \ 22 | python-pip \ 23 | unzip && \ 24 | rm -rf /var/lib/apt/lists/* && \ 25 | \ 26 | pip install -U crcmod && \ 27 | rm -rf $HOME/.cache/pip && \ 28 | \ 29 | curl https://sdk.cloud.google.com | bash -s -- --disable-prompts --install-dir=/usr/lib && \ 30 | gcloud config set core/disable_usage_reporting true && \ 31 | gcloud config set component_manager/disable_update_check true && \ 32 | gcloud config set metrics/environment github_docker_image && \ 33 | \ 34 | gcloud components install \ 35 | app-engine-go \ 36 | beta && \ 37 | \ 38 | chmod +x \ 39 | /usr/lib/google-cloud-sdk/platform/google_appengine/goapp \ 40 | /usr/lib/google-cloud-sdk/platform/google_appengine/godoc \ 41 | /usr/lib/google-cloud-sdk/platform/google_appengine/gofmt \ 42 | /usr/lib/google-cloud-sdk/platform/google_appengine/appcfg.py \ 43 | /usr/lib/google-cloud-sdk/platform/google_appengine/backends_conversion.py \ 44 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkload_client.py \ 45 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkloader.py \ 46 | /usr/lib/google-cloud-sdk/platform/google_appengine/download_appstats.py \ 47 | /usr/lib/google-cloud-sdk/platform/google_appengine/endpointscfg.py && \ 48 | \ 49 | # patch for always use go1.6 runtime 50 | sed -i "s|goroots.GOROOTS\['go1'\])|goroots.GOROOTS\['go1.6'\])|g" $(which goapp) && \ 51 | \ 52 | curl -o go.tgz -sSL "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz" && \ 53 | echo "${GOLANG_DOWNLOAD_SHA256} *go.tgz" | sha256sum -c - && \ 54 | tar -C /usr/local -xzf go.tgz && \ 55 | rm go.tgz 56 | 57 | VOLUME ["/root/.config"] 58 | -------------------------------------------------------------------------------- /1.6/slim/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - name: 'gcr.io/cloud-builders/docker' 3 | args: 4 | - build 5 | - -t 6 | - gcr.io/$PROJECT_ID/appengine/go:1.6-slim 7 | - . 8 | 9 | images: 10 | - gcr.io/$PROJECT_ID/appengine/go:1.6-slim 11 | 12 | timeout: 600s 13 | -------------------------------------------------------------------------------- /1.8/jessie/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | LABEL maintainer "Mercari, Inc" 3 | 4 | ENV GOPATH=/go \ 5 | PATH=/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:$PATH 6 | 7 | ARG APT_MIRROR=httpredir.debian.org 8 | ARG GOLANG_VERSION=1.8.5 9 | ARG GOLANG_DOWNLOAD_SHA256=4f8aeea2033a2d731f2f75c4d0a4995b357b22af56ed69b3015f4291fca4d42d 10 | 11 | RUN sed -ri "s/(deb|httpredir).debian.org/${APT_MIRROR}/g" /etc/apt/sources.list && \ 12 | set -eux && \ 13 | apt-get update && \ 14 | apt-get install -yqq --no-install-suggests --no-install-recommends \ 15 | curl \ 16 | gcc \ 17 | git \ 18 | libc6-dev \ 19 | make \ 20 | openjdk-7-jdk \ 21 | openssh-client \ 22 | python-dev \ 23 | python-pip \ 24 | unzip && \ 25 | rm -rf /var/lib/apt/lists/* && \ 26 | \ 27 | pip install -U crcmod && \ 28 | rm -rf $HOME/.cache/pip && \ 29 | \ 30 | curl https://sdk.cloud.google.com | bash -s -- --disable-prompts --install-dir=/usr/lib && \ 31 | gcloud config set core/disable_usage_reporting true && \ 32 | gcloud config set component_manager/disable_update_check true && \ 33 | gcloud config set metrics/environment github_docker_image && \ 34 | \ 35 | gcloud components install \ 36 | app-engine-go \ 37 | beta \ 38 | cloud-datastore-emulator \ 39 | emulator-reverse-proxy \ 40 | pubsub-emulator && \ 41 | \ 42 | chmod +x \ 43 | /usr/lib/google-cloud-sdk/platform/google_appengine/goapp \ 44 | /usr/lib/google-cloud-sdk/platform/google_appengine/godoc \ 45 | /usr/lib/google-cloud-sdk/platform/google_appengine/gofmt \ 46 | /usr/lib/google-cloud-sdk/platform/google_appengine/appcfg.py \ 47 | /usr/lib/google-cloud-sdk/platform/google_appengine/backends_conversion.py \ 48 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkload_client.py \ 49 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkloader.py \ 50 | /usr/lib/google-cloud-sdk/platform/google_appengine/download_appstats.py \ 51 | /usr/lib/google-cloud-sdk/platform/google_appengine/endpointscfg.py && \ 52 | \ 53 | # patch for always use go1.8 runtime 54 | sed -i "s|goroots.GOROOTS\['go1'\])|goroots.GOROOTS\['go1.8'\])|g" $(which goapp) && \ 55 | \ 56 | curl -o go.tgz -sSL "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz" && \ 57 | echo "${GOLANG_DOWNLOAD_SHA256} *go.tgz" | sha256sum -c - && \ 58 | tar -C /usr/local -xzf go.tgz && \ 59 | rm go.tgz 60 | 61 | VOLUME ["/root/.config"] 62 | -------------------------------------------------------------------------------- /1.8/jessie/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - name: 'gcr.io/cloud-builders/docker' 3 | args: 4 | - build 5 | - -t 6 | - gcr.io/$PROJECT_ID/appengine/go:1.8-jessie 7 | - . 8 | - name: 'gcr.io/cloud-builders/docker' 9 | args: 10 | - tag 11 | - gcr.io/$PROJECT_ID/appengine/go:1.8-jessie 12 | - gcr.io/$PROJECT_ID/appengine/go:1.8 13 | 14 | images: 15 | - gcr.io/$PROJECT_ID/appengine/go:1.8-jessie 16 | - gcr.io/$PROJECT_ID/appengine/go:1.8 17 | 18 | timeout: 600s 19 | -------------------------------------------------------------------------------- /1.8/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie-slim 2 | LABEL maintainer "Mercari, Inc" 3 | 4 | ARG APT_MIRROR=httpredir.debian.org 5 | ARG GOLANG_VERSION=1.8.5 6 | ARG GOLANG_DOWNLOAD_SHA256=4f8aeea2033a2d731f2f75c4d0a4995b357b22af56ed69b3015f4291fca4d42d 7 | 8 | ENV GOPATH=/go \ 9 | PATH=/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:$PATH 10 | 11 | RUN sed -ri "s/(deb|httpredir).debian.org/${APT_MIRROR}/g" /etc/apt/sources.list && \ 12 | set -eux && \ 13 | apt-get update && \ 14 | apt-get install -yqq --no-install-suggests --no-install-recommends \ 15 | curl \ 16 | gcc \ 17 | git \ 18 | libc6-dev \ 19 | make \ 20 | openssh-client \ 21 | python-dev \ 22 | python-pip \ 23 | unzip && \ 24 | rm -rf /var/lib/apt/lists/* && \ 25 | \ 26 | pip install -U crcmod && \ 27 | rm -rf $HOME/.cache/pip && \ 28 | \ 29 | curl https://sdk.cloud.google.com | bash -s -- --disable-prompts --install-dir=/usr/lib && \ 30 | gcloud config set core/disable_usage_reporting true && \ 31 | gcloud config set component_manager/disable_update_check true && \ 32 | gcloud config set metrics/environment github_docker_image && \ 33 | \ 34 | gcloud components install \ 35 | app-engine-go \ 36 | beta && \ 37 | \ 38 | chmod +x \ 39 | /usr/lib/google-cloud-sdk/platform/google_appengine/goapp \ 40 | /usr/lib/google-cloud-sdk/platform/google_appengine/godoc \ 41 | /usr/lib/google-cloud-sdk/platform/google_appengine/gofmt \ 42 | /usr/lib/google-cloud-sdk/platform/google_appengine/appcfg.py \ 43 | /usr/lib/google-cloud-sdk/platform/google_appengine/backends_conversion.py \ 44 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkload_client.py \ 45 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkloader.py \ 46 | /usr/lib/google-cloud-sdk/platform/google_appengine/download_appstats.py \ 47 | /usr/lib/google-cloud-sdk/platform/google_appengine/endpointscfg.py && \ 48 | \ 49 | # patch for always use go1.8 runtime 50 | sed -i "s|goroots.GOROOTS\['go1'\])|goroots.GOROOTS\['go1.8'\])|g" $(which goapp) && \ 51 | \ 52 | curl -o go.tgz -sSL "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz" && \ 53 | echo "${GOLANG_DOWNLOAD_SHA256} *go.tgz" | sha256sum -c - && \ 54 | tar -C /usr/local -xzf go.tgz && \ 55 | rm go.tgz 56 | 57 | VOLUME ["/root/.config"] 58 | -------------------------------------------------------------------------------- /1.8/slim/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - name: 'gcr.io/cloud-builders/docker' 3 | args: 4 | - build 5 | - -t 6 | - gcr.io/$PROJECT_ID/appengine/go:1.8-slim 7 | - . 8 | 9 | images: 10 | - gcr.io/$PROJECT_ID/appengine/go:1.8-slim 11 | 12 | timeout: 600s 13 | -------------------------------------------------------------------------------- /1.9/jessie/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | LABEL maintainer "Mercari, Inc" 3 | 4 | ENV GOPATH=/go \ 5 | PATH=/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:$PATH 6 | 7 | ARG APT_MIRROR=httpredir.debian.org 8 | ARG GOLANG_VERSION=1.9.2 9 | ARG GOLANG_DOWNLOAD_SHA256=de874549d9a8d8d8062be05808509c09a88a248e77ec14eb77453530829ac02b 10 | 11 | RUN sed -ri "s/(deb|httpredir).debian.org/${APT_MIRROR}/g" /etc/apt/sources.list && \ 12 | set -eux && \ 13 | apt-get update && \ 14 | apt-get install -yqq --no-install-suggests --no-install-recommends \ 15 | curl \ 16 | gcc \ 17 | git \ 18 | libc6-dev \ 19 | make \ 20 | openjdk-7-jdk \ 21 | openssh-client \ 22 | python-dev \ 23 | python-pip \ 24 | unzip && \ 25 | rm -rf /var/lib/apt/lists/* && \ 26 | \ 27 | pip install -U crcmod && \ 28 | rm -rf $HOME/.cache/pip && \ 29 | \ 30 | curl https://sdk.cloud.google.com | bash -s -- --disable-prompts --install-dir=/usr/lib && \ 31 | gcloud config set core/disable_usage_reporting true && \ 32 | gcloud config set component_manager/disable_update_check true && \ 33 | gcloud config set metrics/environment github_docker_image && \ 34 | \ 35 | gcloud components install \ 36 | app-engine-go \ 37 | beta \ 38 | cloud-datastore-emulator \ 39 | emulator-reverse-proxy \ 40 | pubsub-emulator && \ 41 | \ 42 | chmod +x \ 43 | /usr/lib/google-cloud-sdk/platform/google_appengine/goapp \ 44 | /usr/lib/google-cloud-sdk/platform/google_appengine/godoc \ 45 | /usr/lib/google-cloud-sdk/platform/google_appengine/gofmt \ 46 | /usr/lib/google-cloud-sdk/platform/google_appengine/appcfg.py \ 47 | /usr/lib/google-cloud-sdk/platform/google_appengine/backends_conversion.py \ 48 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkload_client.py \ 49 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkloader.py \ 50 | /usr/lib/google-cloud-sdk/platform/google_appengine/download_appstats.py \ 51 | /usr/lib/google-cloud-sdk/platform/google_appengine/endpointscfg.py && \ 52 | \ 53 | # patch for always use go1.9 runtime 54 | sed -i "s|goroots.GOROOTS\['go1'\])|goroots.GOROOTS\['go1.9'\])|g" $(which goapp) && \ 55 | \ 56 | curl -o go.tgz -sSL "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz" && \ 57 | echo "${GOLANG_DOWNLOAD_SHA256} *go.tgz" | sha256sum -c - && \ 58 | tar -C /usr/local -xzf go.tgz && \ 59 | rm go.tgz 60 | 61 | VOLUME ["/root/.config"] 62 | -------------------------------------------------------------------------------- /1.9/jessie/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - name: 'gcr.io/cloud-builders/docker' 3 | args: 4 | - build 5 | - -t 6 | - gcr.io/$PROJECT_ID/appengine/go:1.9-jessie 7 | - . 8 | - name: 'gcr.io/cloud-builders/docker' 9 | args: 10 | - tag 11 | - gcr.io/$PROJECT_ID/appengine/go:1.9-jessie 12 | - gcr.io/$PROJECT_ID/appengine/go:1.9 13 | 14 | images: 15 | - gcr.io/$PROJECT_ID/appengine/go:1.9-jessie 16 | - gcr.io/$PROJECT_ID/appengine/go:1.9 17 | 18 | timeout: 600s 19 | -------------------------------------------------------------------------------- /1.9/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie-slim 2 | LABEL maintainer "Mercari, Inc" 3 | 4 | ARG APT_MIRROR=httpredir.debian.org 5 | ARG GOLANG_VERSION=1.9.2 6 | ARG GOLANG_DOWNLOAD_SHA256=de874549d9a8d8d8062be05808509c09a88a248e77ec14eb77453530829ac02b 7 | 8 | ENV GOPATH=/go \ 9 | PATH=/go/bin:/usr/local/go/bin:/usr/lib/google-cloud-sdk/bin:/usr/lib/google-cloud-sdk/platform/google_appengine:$PATH 10 | 11 | RUN sed -ri "s/(deb|httpredir).debian.org/${APT_MIRROR}/g" /etc/apt/sources.list && \ 12 | set -eux && \ 13 | apt-get update && \ 14 | apt-get install -yqq --no-install-suggests --no-install-recommends \ 15 | curl \ 16 | gcc \ 17 | git \ 18 | libc6-dev \ 19 | make \ 20 | openssh-client \ 21 | python-dev \ 22 | python-pip \ 23 | unzip && \ 24 | rm -rf /var/lib/apt/lists/* && \ 25 | \ 26 | pip install -U crcmod && \ 27 | rm -rf $HOME/.cache/pip && \ 28 | \ 29 | curl https://sdk.cloud.google.com | bash -s -- --disable-prompts --install-dir=/usr/lib && \ 30 | gcloud config set core/disable_usage_reporting true && \ 31 | gcloud config set component_manager/disable_update_check true && \ 32 | gcloud config set metrics/environment github_docker_image && \ 33 | \ 34 | gcloud components install \ 35 | app-engine-go \ 36 | beta && \ 37 | \ 38 | chmod +x \ 39 | /usr/lib/google-cloud-sdk/platform/google_appengine/goapp \ 40 | /usr/lib/google-cloud-sdk/platform/google_appengine/godoc \ 41 | /usr/lib/google-cloud-sdk/platform/google_appengine/gofmt \ 42 | /usr/lib/google-cloud-sdk/platform/google_appengine/appcfg.py \ 43 | /usr/lib/google-cloud-sdk/platform/google_appengine/backends_conversion.py \ 44 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkload_client.py \ 45 | /usr/lib/google-cloud-sdk/platform/google_appengine/bulkloader.py \ 46 | /usr/lib/google-cloud-sdk/platform/google_appengine/download_appstats.py \ 47 | /usr/lib/google-cloud-sdk/platform/google_appengine/endpointscfg.py && \ 48 | \ 49 | # patch for always use go1.9 runtime 50 | sed -i "s|goroots.GOROOTS\['go1'\])|goroots.GOROOTS\['go1.9'\])|g" $(which goapp) && \ 51 | \ 52 | curl -o go.tgz -sSL "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz" && \ 53 | echo "${GOLANG_DOWNLOAD_SHA256} *go.tgz" | sha256sum -c - && \ 54 | tar -C /usr/local -xzf go.tgz && \ 55 | rm go.tgz 56 | 57 | VOLUME ["/root/.config"] 58 | -------------------------------------------------------------------------------- /1.9/slim/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - name: 'gcr.io/cloud-builders/docker' 3 | args: 4 | - build 5 | - -t 6 | - gcr.io/$PROJECT_ID/appengine/go:1.9-slim 7 | - . 8 | 9 | images: 10 | - gcr.io/$PROJECT_ID/appengine/go:1.9-slim 11 | 12 | timeout: 600s 13 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please read the CLA below carefully before submitting your contribution. 4 | 5 | https://www.mercari.com/cla/ 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Mercari, Inc. 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WE CONTINUE THE DEVELOPMENT AT [gcpug/docker-appengine-go](https://github.com/gcpug/docker-appengine-go). This repository is deprecated, and no further updates will be done on the code base, nor issue/prs will be answered or attended. 2 | 3 | -------------------------------------------------------------------------------- /cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | # Original 3 | # https://github.com/GoogleCloudPlatform/cloud-builders-community/blob/master/cloudbuild.yaml 4 | 5 | - name: 'gcr.io/cloud-builders/gcloud' 6 | entrypoint: 'bash' 7 | args: 8 | - '-c' 9 | - | 10 | # File that contains failures. 11 | failure_file=failure.log 12 | touch ${failure_file} 13 | 14 | # Loop through the builders, and build independently. 15 | for f in $(find . -mindepth 2 -type f -name 'cloudbuild.yaml'); 16 | do 17 | echo "Building ${f%/*} ... " 18 | ( 19 | gcloud alpha builds submit ${f%/*} --config=${f} --gcs-log-dir="$_GCS_LOG_DIR" 2>&1 > /dev/null 20 | if [[ $? -ne 0 ]]; then 21 | echo "${f%/*} failed" >> ${failure_file} 22 | fi 23 | ) & 24 | done 25 | wait 26 | 27 | # Check if there is any failure. 28 | if [[ -s ${failure_file} ]]; then 29 | echo "Some builds failed:" 30 | cat ${failure_file} 31 | echo "Exiting." 32 | exit 1 33 | fi 34 | echo "All builds succeeded." 35 | tags: ['cloud-builder'] 36 | options: 37 | machineType: 'N1_HIGHCPU_8' 38 | --------------------------------------------------------------------------------