|
| 1 | +# Copyright 2024 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 arm64v8/golang:1.22 AS build |
| 6 | +LABEL maintainer= "[email protected]" |
| 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 arm64v8/debian:bookworm |
| 28 | +LABEL org.opencontainers.image.authors= "[email protected]" |
| 29 | + |
| 30 | +ENV DEBIAN_FRONTEND=noninteractive |
| 31 | + |
| 32 | +# bzr: Bazaar VCS supported by cmd/go |
| 33 | +# fonts-droid-fallback: required by x/mobile repo |
| 34 | +# fossil: Fossil VCS supported by cmd/go |
| 35 | +# gcc: for building Go's bootstrap 'dist' prog |
| 36 | +# gdb: optionally used by runtime tests for gdb |
| 37 | +# gfortran: for compiling cgo with fortran support (multilib for 386) |
| 38 | +# git: git VCS supported by cmd/go |
| 39 | +# g++: used for swig tests and building some benchmarks |
| 40 | +# libc6-dev: for building Go's bootstrap 'dist' prog |
| 41 | +# libgles2-mesa-dev: required by x/mobile repo |
| 42 | +# libopenal-dev: required by x/mobile repo |
| 43 | +# less: misc basic tool |
| 44 | +# linux-perf: for performance analysis on perf builders |
| 45 | +# lsof: misc basic tool |
| 46 | +# make: used for setting up benchmarks in the x/benchmark builders |
| 47 | +# mercurial: mercurial VCS supported by cmd/go |
| 48 | +# netbase: for net package tests, issue 42750 |
| 49 | +# patch: used for building some benchmarks |
| 50 | +# procps: misc basic tool |
| 51 | +# psmisc: misc basic tool |
| 52 | +# strace: optionally used by some net/http tests |
| 53 | +# subversion: subversion VCS supported by cmd/go |
| 54 | +# swig: used for c/c++ interop related tests |
| 55 | +RUN apt-get update && apt-get install -y \ |
| 56 | + --no-install-recommends \ |
| 57 | + bzr \ |
| 58 | + ca-certificates \ |
| 59 | + curl \ |
| 60 | + fonts-droid-fallback \ |
| 61 | + fossil \ |
| 62 | + gcc \ |
| 63 | + gdb \ |
| 64 | + gfortran \ |
| 65 | + git \ |
| 66 | + g++ \ |
| 67 | + iptables \ |
| 68 | + iproute2 \ |
| 69 | + libc6-dev \ |
| 70 | + libgles2-mesa-dev \ |
| 71 | + libopenal-dev \ |
| 72 | + less \ |
| 73 | + linux-perf \ |
| 74 | + lsof \ |
| 75 | + make \ |
| 76 | + mercurial \ |
| 77 | + netbase \ |
| 78 | + openssh-server \ |
| 79 | + patch \ |
| 80 | + procps \ |
| 81 | + psmisc \ |
| 82 | + strace \ |
| 83 | + subversion \ |
| 84 | + sudo \ |
| 85 | + swig \ |
| 86 | + && rm -rf /var/lib/apt/lists/* |
| 87 | + |
| 88 | +COPY --from=build /go/bin/* /usr/local/bin/ |
| 89 | +COPY cmd/buildlet/stage0/run-worker.sh /usr/local/bin/ |
| 90 | + |
| 91 | +CMD ["/usr/local/bin/run-worker.sh"] |
0 commit comments