Skip to content

Commit 18327fd

Browse files
mknyszekgopherbot
authored andcommitted
env/linux-arm64-bookworm: add image
This is an attempt to upgrade the Debian image for linux-arm64. For golang/go#69763. Change-Id: I73e579bcd5599e4eb4461d81cd79ed45d8239dad Reviewed-on: https://go-review.googlesource.com/c/build/+/622039 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Michael Knyszek <[email protected]>
1 parent 7980781 commit 18327fd

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed

env/linux-arm64-bookworm/Dockerfile

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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"]

env/linux-arm64-bookworm/Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# 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+
5+
IMAGE_NAME=$(shell basename $(CURDIR))
6+
7+
usage:
8+
echo "see Makefile for usage for building $(IMAGE_NAME)"
9+
10+
docker: Dockerfile
11+
# If this command is failing, run:
12+
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
13+
# docker buildx create --name mybuilder
14+
docker buildx build -t golang/$(IMAGE_NAME) --platform linux/arm64 --load -f Dockerfile ../..
15+
16+
testssh: docker
17+
go install golang.org/x/build/cmd/buildlet/testssh
18+
testssh --start-image=golang/$(IMAGE_NAME)
19+
20+
push-staging: docker
21+
go install golang.org/x/build/cmd/xb
22+
xb --staging docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):latest
23+
xb --staging docker push REPO/$(IMAGE_NAME):latest
24+
25+
push-prod: docker
26+
xb --prod docker tag golang/$(IMAGE_NAME) REPO/$(IMAGE_NAME):latest
27+
xb --prod docker push REPO/$(IMAGE_NAME):latest

0 commit comments

Comments
 (0)