Dockerfile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright 2018 The Go Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style
  3. # license that can be found in the LICENSE file.
  4. FROM golang:1.13 AS build
  5. LABEL maintainer "golang-dev@googlegroups.com"
  6. ENV GO111MODULE=on
  7. RUN mkdir /gocache
  8. ENV GOCACHE /gocache
  9. COPY go.mod /go/src/golang.org/x/build/go.mod
  10. COPY go.sum /go/src/golang.org/x/build/go.sum
  11. # Optimization for iterative docker build speed, not necessary for correctness:
  12. # TODO: write a tool to make writing Go module-friendly Dockerfiles easier.
  13. RUN go install cloud.google.com/go/storage
  14. RUN go install golang.org/x/build/autocertcache
  15. RUN go install go4.org/syncutil/singleflight
  16. RUN go install golang.org/x/crypto/acme/autocert
  17. COPY . /go/src/golang.org/x/net
  18. # Install binary to /go/bin:
  19. WORKDIR /go/src/golang.org/x/net/http2/h2demo
  20. RUN go install -tags "netgo"
  21. FROM debian:stretch
  22. RUN apt-get update && apt-get install -y --no-install-recommends \
  23. ca-certificates netbase \
  24. && rm -rf /var/lib/apt/lists/*
  25. COPY --from=build /go/bin/h2demo /h2demo