blob: 98fc55c3be241bfac1f0f6c86b864ab0bf6bc8c3 [file] [log] [blame]
Carlos Amedee52ae77a2023-06-14 11:29:08 -04001# Copyright 2023 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
5FROM golang/buildlet-stage0 AS stage0
6
Michael Pratta0289cb2024-02-26 13:06:00 -05007# Build perf_to_profile to make go tool pprof work with perf.data files.
8FROM debian:bookworm AS perftoprofile
9LABEL maintainer="golang-dev@googlegroups.com"
10
11ENV DEBIAN_FRONTEND noninteractive
12
13RUN apt-get update && apt-get install -y \
14 --no-install-recommends \
15 ca-certificates \
16 curl \
17 g++ \
18 git \
19 libelf-dev \
20 libcap-dev
21
22RUN curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64" > bazelisk && \
23 chmod +x bazelisk
24
25RUN git clone https://github.com/google/perf_data_converter && \
26 cd perf_data_converter && \
27 /bazelisk build //src:perf_to_profile && \
28 cp bazel-bin/src/perf_to_profile /perf_to_profile.exe # COPY --from won't be able to resolve symlink, so do it now.
29
30# Actual image build.
Carlos Amedee52ae77a2023-06-14 11:29:08 -040031FROM debian:bookworm
32MAINTAINER golang-dev <golang-dev@googlegroups.com>
33
34ENV DEBIAN_FRONTEND noninteractive
35
36# bzr: Bazaar VCS supported by cmd/go
37# fonts-droid-fallback: required by x/mobile repo
38# fossil: Fossil VCS supported by cmd/go
39# gcc-multilib: for 32-bit builds
40# gcc: for building Go's bootstrap 'dist' prog
41# gdb: optionally used by runtime tests for gdb
42# gfortran: for compiling cgo with fortran support (multilib for 386)
43# git: git VCS supported by cmd/go
Michael Pratt0f15e802024-02-26 12:48:31 -050044# less: misc basic tool
Carlos Amedee52ae77a2023-06-14 11:29:08 -040045# libc6-dev-i386: for 32-bit builds
46# libc6-dev: for building Go's bootstrap 'dist' prog
47# libgles2-mesa-dev: required by x/mobile repo
48# libopenal-dev: required by x/mobile repo
Michael Pratt4a5e2a92024-02-23 16:18:36 -050049# linux-perf: for performance analysis on perf builders
Carlos Amedee52ae77a2023-06-14 11:29:08 -040050# lsof: misc basic tool
51# make: used for setting up benchmarks in the x/benchmark builders
52# mercurial: mercurial VCS supported by cmd/go
53# netbase: for net package tests, issue 42750
54# procps: misc basic tool
55# psmisc: misc basic tool
56# strace: optionally used by some net/http tests
57# subversion: subversion VCS supported by cmd/go
58# swig: used for c/c++ interop related tests
59RUN apt-get update && apt-get install -y \
60 --no-install-recommends \
61 bzr \
62 ca-certificates \
63 curl \
64 fonts-droid-fallback \
65 fossil \
66 gcc \
67 gcc-multilib \
68 gdb \
69 gfortran \
70 gfortran-multilib \
71 git \
72 iptables \
Heschi Kreinickc0f90b02023-07-25 13:46:54 -040073 iproute2 \
Michael Pratt0f15e802024-02-26 12:48:31 -050074 less \
Carlos Amedee52ae77a2023-06-14 11:29:08 -040075 libc6-dev \
76 libc6-dev-i386 \
77 libgles2-mesa-dev \
78 libopenal-dev \
Michael Pratt4a5e2a92024-02-23 16:18:36 -050079 linux-perf \
Carlos Amedee52ae77a2023-06-14 11:29:08 -040080 lsof \
81 make \
82 mercurial \
83 netbase \
84 openssh-server \
85 procps \
86 psmisc \
87 strace \
88 subversion \
Heschi Kreinickc31a5bb2023-06-29 11:13:59 -040089 sudo \
Carlos Amedee52ae77a2023-06-14 11:29:08 -040090 swig \
91 && rm -rf /var/lib/apt/lists/*
92
Heschi Kreinickd9171102023-06-27 17:40:56 -040093COPY --from=stage0 /go/bin/* /usr/local/bin/
Michael Pratta0289cb2024-02-26 13:06:00 -050094COPY --from=perftoprofile /perf_to_profile.exe /usr/local/bin/perf_to_profile
Carlos Amedee52ae77a2023-06-14 11:29:08 -040095
Heschi Kreinickd9171102023-06-27 17:40:56 -040096CMD ["/usr/local/bin/run-worker.sh"]