golang.org/x/build@v0.0.0-20240506185731-218518f32b70/cmd/gerritbot/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:latest as builder
     6  
     7  # Because alpine is used below... TODO: just use Debian below and re-enable this?
     8  ENV CGO_ENABLED=0
     9  
    10  ENV GO111MODULE=on
    11  ENV GOPROXY=https://proxy.golang.org
    12  
    13  RUN mkdir /gocache
    14  ENV GOCACHE /gocache
    15  
    16  COPY go.mod /go/src/golang.org/x/build/go.mod
    17  COPY go.sum /go/src/golang.org/x/build/go.sum
    18  
    19  WORKDIR /go/src/golang.org/x/build
    20  
    21  # Optimization for iterative docker build speed, not necessary for correctness:
    22  # TODO: write a tool to make writing Go module-friendly Dockerfiles easier.
    23  RUN go install cloud.google.com/go/compute/metadata
    24  RUN go install github.com/google/go-github/github
    25  RUN go install golang.org/x/oauth2
    26  COPY autocertcache /go/src/golang.org/x/build/autocertcache
    27  COPY gerrit /go/src/golang.org/x/build/gerrit
    28  COPY maintner /go/src/golang.org/x/build/maintner
    29  COPY internal /go/src/golang.org/x/build/internal
    30  COPY cmd/pubsubhelper/pubsubtypes /go/src/golang.org/x/build/cmd/pubsubhelper/pubsubtypes
    31  RUN go install golang.org/x/build/gerrit
    32  RUN go install golang.org/x/build/internal/https
    33  RUN go install golang.org/x/build/maintner
    34  RUN go install golang.org/x/build/maintner/godata
    35  
    36  COPY . /go/src/golang.org/x/build/
    37  RUN go install golang.org/x/build/cmd/gerritbot
    38  
    39  FROM alpine
    40  LABEL maintainer="golang-dev@googlegroups.com"
    41  # See https://github.com/golang/go/issues/23705 for why tini is needed
    42  RUN apk add --no-cache git tini
    43  RUN git config --global user.email "letsusegerrit@gmail.com"
    44  RUN git config --global user.name "GerritBot"
    45  RUN git config --global http.cookiefile "/gitcookies"
    46  COPY --from=builder /go/bin/gerritbot /
    47  ENTRYPOINT ["/sbin/tini", "--", "/gerritbot"]