Skip to content

Commit

Permalink
http2/h2demo: stop using gitlock, use Go modules
Browse files Browse the repository at this point in the history
Updates golang/go#26872

Change-Id: If2a96708d1fcf43b7ce20a48fa5ae3492f970187
Reviewed-on: https://go-review.googlesource.com/c/net/+/176318
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
  • Loading branch information
bradfitz committed May 9, 2019
1 parent f4e77d3 commit a4d6f7f
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 252 deletions.
168 changes: 21 additions & 147 deletions http2/h2demo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,162 +2,36 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

FROM golang:1.11 AS build
FROM golang:1.12 AS build
LABEL maintainer "golang-dev@googlegroups.com"

# BEGIN deps (run `make update-deps` to update)
ENV GO111MODULE=on
ENV GOPROXY=https://proxy.golang.org

# Repo cloud.google.com/go at b5eca92 (2018-10-23)
ENV REV=b5eca92245a08e245bc29c4880c9779ea4aeaa9a
RUN go get -d cloud.google.com/go/compute/metadata `#and 7 other pkgs` &&\
(cd /go/src/cloud.google.com/go && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)
RUN mkdir /gocache
ENV GOCACHE /gocache

# Repo github.com/golang/protobuf at b4deda0 (2018-04-30)
ENV REV=b4deda0973fb4c70b50d226b1af49f3da59f5265
RUN go get -d github.com/golang/protobuf/proto `#and 6 other pkgs` &&\
(cd /go/src/github.com/golang/protobuf && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)
COPY go.mod /go/src/golang.org/x/build/go.mod
COPY go.sum /go/src/golang.org/x/build/go.sum

# Repo github.com/googleapis/gax-go at 317e000 (2017-09-15)
ENV REV=317e0006254c44a0ac427cc52a0e083ff0b9622f
RUN go get -d github.com/googleapis/gax-go &&\
(cd /go/src/github.com/googleapis/gax-go && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)
# Optimization for iterative docker build speed, not necessary for correctness:
# TODO: write a tool to make writing Go module-friendly Dockerfiles easier.
RUN go install cloud.google.com/go/storage
RUN go install golang.org/x/build/autocertcache
RUN go install go4.org/syncutil/singleflight
RUN go install golang.org/x/crypto/acme/autocert

# Repo go.opencensus.io at ebd8d31 (2018-05-16)
ENV REV=ebd8d31470fedf6c27d0e3056653ddff642509b8
RUN go get -d go.opencensus.io/internal `#and 11 other pkgs` &&\
(cd /go/src/go.opencensus.io && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)
COPY . /go/src/golang.org/x/net

# Repo go4.org at fba789b (2018-01-03)
ENV REV=fba789b7e39ba524b9e60c45c37a50fae63a2a09
RUN go get -d go4.org/syncutil/singleflight &&\
(cd /go/src/go4.org && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)
# Install binary to /go/bin:
WORKDIR /go/src/golang.org/x/net/http2/h2demo
RUN go install -tags "h2demo netgo"

# Repo golang.org/x/build at 193361e (2019-02-01)
ENV REV=193361e263a8c4175cbb6769bb2a59d8c4f8183e
RUN go get -d golang.org/x/build/autocertcache &&\
(cd /go/src/golang.org/x/build && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)

# Repo golang.org/x/crypto at c7b33c3 (2019-01-28)
ENV REV=c7b33c32a30bae9ba07d37eb4d86f1f8b0f644fb
RUN go get -d golang.org/x/crypto/acme `#and 2 other pkgs` &&\
(cd /go/src/golang.org/x/crypto && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)
FROM debian:stretch
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates netbase \
&& rm -rf /var/lib/apt/lists/*

# Repo golang.org/x/oauth2 at c6d9d57 (2019-01-18)
ENV REV=c6d9d5723bcdfb8ec25b90ea254cffe6025386d6
RUN go get -d golang.org/x/oauth2 `#and 5 other pkgs` &&\
(cd /go/src/golang.org/x/oauth2 && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)

# Repo golang.org/x/sys at 4d1cda0 (2018-12-13)
ENV REV=4d1cda033e0619309c606fc686de3adcf599539e
RUN go get -d golang.org/x/sys/unix &&\
(cd /go/src/golang.org/x/sys && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)

# Repo golang.org/x/text at 6f44c5a (2018-10-30)
ENV REV=6f44c5a2ea40ee3593d98cdcc905cc1fdaa660e2
RUN go get -d golang.org/x/text/secure/bidirule `#and 4 other pkgs` &&\
(cd /go/src/golang.org/x/text && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)

# Repo google.golang.org/api at 41dc4b6 (2018-12-17)
ENV REV=41dc4b66e69d5dbf20efe4ba67e19d214d147ae3
RUN go get -d google.golang.org/api/gensupport `#and 10 other pkgs` &&\
(cd /go/src/google.golang.org/api && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)

# Repo google.golang.org/genproto at 86e600f (2018-04-27)
ENV REV=86e600f69ee4704c6efbf6a2a40a5c10700e76c2
RUN go get -d google.golang.org/genproto/googleapis/api/annotations `#and 4 other pkgs` &&\
(cd /go/src/google.golang.org/genproto && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)

# Repo google.golang.org/grpc at 07ef407 (2018-08-06)
ENV REV=07ef407d991f1004e6c3367c8f452ed9a02f17ff
RUN go get -d google.golang.org/grpc `#and 26 other pkgs` &&\
(cd /go/src/google.golang.org/grpc && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV)

# Optimization to speed up iterative development, not necessary for correctness:
RUN go install cloud.google.com/go/compute/metadata \
cloud.google.com/go/iam \
cloud.google.com/go/internal \
cloud.google.com/go/internal/optional \
cloud.google.com/go/internal/trace \
cloud.google.com/go/internal/version \
cloud.google.com/go/storage \
github.com/golang/protobuf/proto \
github.com/golang/protobuf/protoc-gen-go/descriptor \
github.com/golang/protobuf/ptypes \
github.com/golang/protobuf/ptypes/any \
github.com/golang/protobuf/ptypes/duration \
github.com/golang/protobuf/ptypes/timestamp \
github.com/googleapis/gax-go \
go.opencensus.io/internal \
go.opencensus.io/internal/tagencoding \
go.opencensus.io/plugin/ochttp \
go.opencensus.io/plugin/ochttp/propagation/b3 \
go.opencensus.io/stats \
go.opencensus.io/stats/internal \
go.opencensus.io/stats/view \
go.opencensus.io/tag \
go.opencensus.io/trace \
go.opencensus.io/trace/internal \
go.opencensus.io/trace/propagation \
go4.org/syncutil/singleflight \
golang.org/x/build/autocertcache \
golang.org/x/crypto/acme \
golang.org/x/crypto/acme/autocert \
golang.org/x/oauth2 \
golang.org/x/oauth2/google \
golang.org/x/oauth2/internal \
golang.org/x/oauth2/jws \
golang.org/x/oauth2/jwt \
golang.org/x/sys/unix \
golang.org/x/text/secure/bidirule \
golang.org/x/text/transform \
golang.org/x/text/unicode/bidi \
golang.org/x/text/unicode/norm \
google.golang.org/api/gensupport \
google.golang.org/api/googleapi \
google.golang.org/api/googleapi/internal/uritemplates \
google.golang.org/api/googleapi/transport \
google.golang.org/api/internal \
google.golang.org/api/iterator \
google.golang.org/api/option \
google.golang.org/api/storage/v1 \
google.golang.org/api/transport/http \
google.golang.org/api/transport/http/internal/propagation \
google.golang.org/genproto/googleapis/api/annotations \
google.golang.org/genproto/googleapis/iam/v1 \
google.golang.org/genproto/googleapis/rpc/code \
google.golang.org/genproto/googleapis/rpc/status \
google.golang.org/grpc \
google.golang.org/grpc/balancer \
google.golang.org/grpc/balancer/base \
google.golang.org/grpc/balancer/roundrobin \
google.golang.org/grpc/codes \
google.golang.org/grpc/connectivity \
google.golang.org/grpc/credentials \
google.golang.org/grpc/encoding \
google.golang.org/grpc/encoding/proto \
google.golang.org/grpc/grpclog \
google.golang.org/grpc/internal \
google.golang.org/grpc/internal/backoff \
google.golang.org/grpc/internal/channelz \
google.golang.org/grpc/internal/envconfig \
google.golang.org/grpc/internal/grpcrand \
google.golang.org/grpc/internal/transport \
google.golang.org/grpc/keepalive \
google.golang.org/grpc/metadata \
google.golang.org/grpc/naming \
google.golang.org/grpc/peer \
google.golang.org/grpc/resolver \
google.golang.org/grpc/resolver/dns \
google.golang.org/grpc/resolver/passthrough \
google.golang.org/grpc/stats \
google.golang.org/grpc/status \
google.golang.org/grpc/tap
# END deps

COPY . /go/src/golang.org/x/net/

RUN go install -tags "h2demo netgo" golang.org/x/net/http2/h2demo

FROM golang:1.11
COPY --from=build /go/bin/h2demo /h2demo

4 changes: 0 additions & 4 deletions http2/h2demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ MUTABLE_VERSION ?= latest
VERSION ?= $(shell git rev-parse --short HEAD)
IMAGE_NAME=h2demo

update-deps:
go install golang.org/x/build/cmd/gitlock
gitlock --update=Dockerfile --ignore=golang.org/x/net --tags=h2demo golang.org/x/net/http2/h2demo

docker: Dockerfile
go install golang.org/x/build/cmd/xb
xb docker build -t golang/$(IMAGE_NAME) -f Dockerfile ../..
Expand Down
10 changes: 6 additions & 4 deletions http2/h2demo/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module golang.org/x/net/http2/h2demo

go 1.12

require (
cloud.google.com/go v0.36.0
cloud.google.com/go v0.38.0
go4.org v0.0.0-20190218023631-ce4c26f7be8e
golang.org/x/build v0.0.0-20190311051652-b8db43dd7225
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net v0.0.0-20190311175648-12eef18f757f
golang.org/x/build v0.0.0-20190509182522-45de920fc22c
golang.org/x/crypto v0.0.0-20190424203555-c05e17bb3b2d
golang.org/x/net v0.0.0-20190502183928-7f726cade0ab
)

replace golang.org/x/net => ../..
Loading

0 comments on commit a4d6f7f

Please sign in to comment.