devapp/devappserver: add Dockerfile in preparation for running on GKE

Since we can’t run an App Engine Flex app on *.golang.org (see
issue), the Flex app.yaml file is removed.

Updates golang/go#20691

Change-Id: Id775962349a88b119c9fe671f9a5180f70528836
Reviewed-on: https://go-review.googlesource.com/46133
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Andrew Bonventre 2017-06-20 12:20:22 -07:00
Родитель 9fb5d0849b
Коммит 4b84ce7680
5 изменённых файлов: 91 добавлений и 13 удалений

2
devapp/devappserver/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,2 @@
devappserver
ca-certificates.crt

Просмотреть файл

@ -0,0 +1,8 @@
# Copyright 2017 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
FROM scratch
LABEL maintainer "golang-dev@googlegroups.com"
COPY ca-certificates.crt /etc/ssl/certs/
COPY devappserver /
ENTRYPOINT ["/devappserver"]

Просмотреть файл

@ -0,0 +1,46 @@
# Copyright 2017 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
FROM golang:1.8
LABEL maintainer "golang-dev@googlegroups.com"
RUN go get -d github.com/aclements/go-gg/generic/slice && \
go get -d github.com/aclements/go-gg/gg && \
go get -d github.com/aclements/go-gg/ggstat && \
go get -d github.com/aclements/go-gg/table && \
cd /go/src/github.com/aclements/go-gg && git reset --hard abd1f791f5ee99465ee7cffe771436379d6cee5a
RUN go get -d github.com/aclements/go-moremath/stats && \
cd /go/src/github.com/aclements/go-moremath && git reset --hard 033754ab1fee508c9f98f2785eec2365964e0b05
RUN go get -d github.com/google/go-github/github && \
cd /go/src/github.com/google/go-github && git reset --hard 7a51fb928f52a196d5f31daefb8a489453ef54ff
RUN go get -d github.com/kylelemons/godebug/pretty && \
cd /go/src/github.com/kylelemons/godebug && git reset --hard a616ab194758ae0a11290d87ca46ee8c440117b0
RUN go get -d golang.org/x/net/context && \
cd /go/src/golang.org/x/net && git reset --hard fe686d45ea04bc1bd4eff6a52865ce8757320325
RUN go get -d golang.org/x/oauth2 && \
cd /go/src/golang.org/x/oauth2 && git reset --hard f047394b6d14284165300fd82dad67edb3a4d7f6
RUN go get -d golang.org/x/sync/errgroup && \
cd /go/src/golang.org/x/sync && git reset --hard f52d1811a62927559de87708c8913c1650ce4f26
# Optimization to speed COPY+go install steps later. This go install
# isn't required for correctness.
RUN go install github.com/aclements/go-gg/generic/slice \
github.com/aclements/go-gg/gg \
github.com/aclements/go-gg/ggstat \
github.com/aclements/go-gg/table \
github.com/aclements/go-moremath/stats \
github.com/google/go-github/github \
github.com/kylelemons/godebug/pretty \
golang.org/x/net/context \
golang.org/x/oauth2 \
golang.org/x/sync/errgroup
COPY . /go/src/golang.org/x/build/
RUN go install -ldflags "-linkmode=external -extldflags '-static -pthread'" golang.org/x/build/devapp/devappserver

Просмотреть файл

@ -0,0 +1,35 @@
# Copyright 2017 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
VERSION=latest
DOCKER_IMAGE_build0=build0/devappserver:latest
DOCKER_CTR_build0=devappserver-build0
build0: *.go Dockerfile.0
docker build --force-rm -f Dockerfile.0 --tag=$(DOCKER_IMAGE_build0) ../..
devappserver: build0
docker create --name $(DOCKER_CTR_build0) $(DOCKER_IMAGE_build0)
docker cp $(DOCKER_CTR_build0):/go/bin/$@ $@
docker rm $(DOCKER_CTR_build0)
ca-certificates.crt:
docker create --name $(DOCKER_CTR_build0) $(DOCKER_IMAGE_build0)
docker cp $(DOCKER_CTR_build0):/etc/ssl/certs/$@ $@
docker rm $(DOCKER_CTR_build0)
docker-prod: Dockerfile devappserver ca-certificates.crt
docker build --force-rm --tag=gcr.io/symbolic-datum-552/devappserver:$(VERSION) .
docker-dev: Dockerfile devappserver ca-certificates.crt
docker build --force-rm --tag=gcr.io/go-dashboard-dev/devappserver:latest .
push-prod: docker-prod
gcloud docker -- push gcr.io/symbolic-datum-552/devappserver:$(VERSION)
push-dev: docker-dev
gcloud docker -- push gcr.io/go-dashboard-dev/devappserver:latest
.PHONY: clean
clean:
$(RM) devappserver
$(RM) ca-certificates.crt

Просмотреть файл

@ -1,13 +0,0 @@
# YAML file necessary to deploy to App Engine Flex.
#
# To deploy, run "gcloud app deploy". You will need to sign up for an account
# and configure your local gcloud settings.
#
# As of March 2017 deployments take 4-8 minutes (to upload all files, build
# a Docker container, and provision that container onto multiple servers). Note
# that libraries will be deployed as they exist on your local filesystem, so
# ensure third party dependencies are up to date.
#
# More info: https://cloud.google.com/appengine/docs/flexible/go/quickstart
runtime: go
env: flex