зеркало из https://github.com/golang/build.git
92 строки
2.5 KiB
Docker
92 строки
2.5 KiB
Docker
# Copyright 2024 The Go Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style
|
|
# license that can be found in the LICENSE file.
|
|
|
|
FROM arm64v8/golang:1.22 AS build
|
|
LABEL maintainer="golang-dev@googlegroups.com"
|
|
|
|
RUN mkdir /gocache
|
|
ENV GOCACHE=/gocache
|
|
|
|
COPY ./go.mod /go/src/golang.org/x/build/go.mod
|
|
COPY ./go.sum /go/src/golang.org/x/build/go.sum
|
|
|
|
WORKDIR /go/src/golang.org/x/build
|
|
|
|
# Optimization for iterative docker build speed, not necessary for correctness:
|
|
# TODO: write a tool to make writing Go module-friendly Dockerfiles easier.
|
|
RUN go install cloud.google.com/go/compute/metadata
|
|
|
|
COPY . /go/src/golang.org/x/build/
|
|
|
|
# Install binary to /go/bin/stage0
|
|
ENV CGO_ENABLED=0
|
|
RUN go install golang.org/x/build/cmd/buildlet/stage0
|
|
RUN go install golang.org/x/build/cmd/bootstrapswarm
|
|
|
|
FROM arm64v8/debian:bookworm
|
|
LABEL org.opencontainers.image.authors="golang-dev@googlegroups.com"
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# bzr: Bazaar VCS supported by cmd/go
|
|
# fonts-droid-fallback: required by x/mobile repo
|
|
# fossil: Fossil VCS supported by cmd/go
|
|
# gcc: for building Go's bootstrap 'dist' prog
|
|
# gdb: optionally used by runtime tests for gdb
|
|
# gfortran: for compiling cgo with fortran support (multilib for 386)
|
|
# git: git VCS supported by cmd/go
|
|
# g++: used for swig tests and building some benchmarks
|
|
# libc6-dev: for building Go's bootstrap 'dist' prog
|
|
# libgles2-mesa-dev: required by x/mobile repo
|
|
# libopenal-dev: required by x/mobile repo
|
|
# less: misc basic tool
|
|
# linux-perf: for performance analysis on perf builders
|
|
# lsof: misc basic tool
|
|
# make: used for setting up benchmarks in the x/benchmark builders
|
|
# mercurial: mercurial VCS supported by cmd/go
|
|
# netbase: for net package tests, issue 42750
|
|
# patch: used for building some benchmarks
|
|
# procps: misc basic tool
|
|
# psmisc: misc basic tool
|
|
# strace: optionally used by some net/http tests
|
|
# subversion: subversion VCS supported by cmd/go
|
|
# swig: used for c/c++ interop related tests
|
|
RUN apt-get update && apt-get install -y \
|
|
--no-install-recommends \
|
|
bzr \
|
|
ca-certificates \
|
|
curl \
|
|
fonts-droid-fallback \
|
|
fossil \
|
|
gcc \
|
|
gdb \
|
|
gfortran \
|
|
git \
|
|
g++ \
|
|
iptables \
|
|
iproute2 \
|
|
libc6-dev \
|
|
libgles2-mesa-dev \
|
|
libopenal-dev \
|
|
less \
|
|
linux-perf \
|
|
lsof \
|
|
make \
|
|
mercurial \
|
|
netbase \
|
|
openssh-server \
|
|
patch \
|
|
procps \
|
|
psmisc \
|
|
strace \
|
|
subversion \
|
|
sudo \
|
|
swig \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=build /go/bin/* /usr/local/bin/
|
|
COPY cmd/buildlet/stage0/run-worker.sh /usr/local/bin/
|
|
|
|
CMD ["/usr/local/bin/run-worker.sh"]
|