Skip to content

Commit

Permalink
Use binutils-gold in builder image
Browse files Browse the repository at this point in the history
There seems to have been a change in the dependencies that now causes
ARMv7 builds to fail:

```
    sigs.k8s.io/kustomize/kyaml/yaml/merge3=$WORK/b742/_pkg_.a
    sigs.k8s.io/kustomize/kyaml/yaml/internal/k8sgen/pkg/util/errors=$WORK/b678/_pkg_.a
    -importcfg $WORK/b001/importcfg.link -buildmode=exe
-buildid=YHfd11eGufJ7RVGSGz2z/H9JgY3lbjsdhQ8_r06Gz/HiYQEtSgCAIHJ7rrNYN6/YHfd11eGufJ7RVGSGz2z
-extld=gcc $WORK/b001/_pkg_.a
    exit status 1
    -c CGO_ENABLED=1 go build -x -o source-controller main.go]: exit
code: 2
```

After trying various things, including downgrading Go, using
packages from `edge`, using `gcc-go` to get a "grouped" version of
the dependencies, it seems that using `binutils-gold` solves the issue
and produces a working build for all our target architectures.

Signed-off-by: Hidde Beydals <hello@hidde.co>
  • Loading branch information
hiddeco committed Jun 8, 2021
1 parent 1aa997c commit 2046c65
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Docker buildkit multi-arch build requires golang alpine
FROM golang:1.16-alpine as builder

RUN apk add gcc pkgconfig libc-dev
RUN apk add --no-cache musl~=1.2 libgit2-dev~=1.1
RUN apk add --no-cache gcc pkgconfig libc-dev binutils-gold musl~=1.2 libgit2-dev~=1.1

WORKDIR /workspace

Expand Down

0 comments on commit 2046c65

Please sign in to comment.