golang.org/x/build@v0.0.0-20240506185731-218518f32b70/devapp/Dockerfile (about) 1 # Copyright 2017 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 5 FROM golang:1.21-bookworm AS builder 6 LABEL maintainer="golang-dev@googlegroups.com" 7 8 RUN mkdir /gocache 9 ENV GOCACHE /gocache 10 11 COPY go.mod /go/src/golang.org/x/build/go.mod 12 COPY go.sum /go/src/golang.org/x/build/go.sum 13 14 WORKDIR /go/src/golang.org/x/build 15 16 # Download module dependencies to improve speed of re-building the 17 # Docker image during minor code changes. 18 RUN go mod download 19 20 COPY . /go/src/golang.org/x/build/ 21 # Install binary to /go/bin: 22 RUN go install golang.org/x/build/devapp 23 24 FROM debian:bookworm 25 LABEL maintainer="golang-dev@googlegroups.com" 26 27 # netbase and ca-certificates are needed for dialing TLS. 28 # The rest are useful for debugging if somebody needs to exec into the container. 29 RUN apt-get update && apt-get install -y \ 30 --no-install-recommends \ 31 netbase \ 32 ca-certificates \ 33 curl \ 34 strace \ 35 procps \ 36 lsof \ 37 psmisc \ 38 && rm -rf /var/lib/apt/lists/* 39 40 COPY --from=builder /go/bin/devapp / 41 COPY devapp/static /static 42 COPY devapp/templates /templates 43 ENTRYPOINT ["/devapp"]