golang.org/x/build@v0.0.0-20240506185731-218518f32b70/cmd/buildlet/stage0/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.19 AS build
     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  # Optimization for iterative docker build speed, not necessary for correctness:
    17  # TODO: write a tool to make writing Go module-friendly Dockerfiles easier.
    18  RUN go install cloud.google.com/go/compute/metadata
    19  
    20  COPY . /go/src/golang.org/x/build/
    21  
    22  # Install binary to /go/bin/stage0
    23  ENV CGO_ENABLED=0
    24  RUN go install golang.org/x/build/cmd/buildlet/stage0
    25  RUN go install golang.org/x/build/cmd/bootstrapswarm
    26  
    27  FROM golang:1.19
    28  COPY --from=build /go/bin/* /go/bin/
    29  COPY cmd/buildlet/stage0/run-worker.sh /go/bin