Release arm64 docker optimization #92

Closed
opened 2025-12-29 01:22:51 +01:00 by adam · 5 comments
Owner

Originally created by @ohdearaugustin on GitHub (Dec 27, 2021).

Originally assigned to: @ohdearaugustin on GitHub.

After we fix #253, there is an issue with the time it takes to build the arm64 go binary for docker. Go needs about 15 mins to compile the binary, which is extremely slow.

More debugging is still required to speed up the build process.

One idea would be to use a build cache for golang.

Originally created by @ohdearaugustin on GitHub (Dec 27, 2021). Originally assigned to: @ohdearaugustin on GitHub. After we fix #253, there is an issue with the time it takes to build the arm64 go binary for docker. Go needs about 15 mins to compile the binary, which is extremely slow. More debugging is still required to speed up the build process. One idea would be to use a build cache for golang.
adam added the bug label 2025-12-29 01:22:51 +01:00
adam closed this issue 2025-12-29 01:22:51 +01:00
Author
Owner

@ohdearaugustin commented on GitHub (Dec 28, 2021):

The main problem seems to be the cross-compilation with qemu--aarch64. I'm currently testing out cross-compilation with go native, but this is a bit more work as thought, as the library go-sqlite is cgo.

@ohdearaugustin commented on GitHub (Dec 28, 2021): The main problem seems to be the cross-compilation with qemu--aarch64. I'm currently testing out cross-compilation with go native, but this is a bit more work as thought, as the library go-sqlite is cgo.
Author
Owner

@huskyii commented on GitHub (Mar 14, 2022):

@ohdearaugustin Hi, as headscale is cgo free now, I think this issue could be closed.

$ lscpu | grep 'Model name'
Model name:                      AMD Ryzen 9 5950X 16-Core Processor

$ time GOOS=linux GOARCH=arm64 GGO_ENABLED=0 go build -ldflags "-s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=dev" cmd/headscale/headscale.go

real	0m0.705s
user	0m1.433s
sys	0m0.379s
@huskyii commented on GitHub (Mar 14, 2022): @ohdearaugustin Hi, as headscale is cgo free now, I think this issue could be closed. ```bash $ lscpu | grep 'Model name' Model name: AMD Ryzen 9 5950X 16-Core Processor $ time GOOS=linux GOARCH=arm64 GGO_ENABLED=0 go build -ldflags "-s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=dev" cmd/headscale/headscale.go real 0m0.705s user 0m1.433s sys 0m0.379s ```
Author
Owner

@ohdearaugustin commented on GitHub (Mar 14, 2022):

@huskyii Thank you for the hint. I should take a look at this issue again.

@ohdearaugustin commented on GitHub (Mar 14, 2022): @huskyii Thank you for the hint. I should take a look at this issue again.
Author
Owner

@kradalby commented on GitHub (Jun 12, 2022):

Any update on this @ohdearaugustin?

@kradalby commented on GitHub (Jun 12, 2022): Any update on this @ohdearaugustin?
Author
Owner

@ohdearaugustin commented on GitHub (Jun 13, 2022):

@kradalby I won't have time until July to tackle that issue again.

@ohdearaugustin commented on GitHub (Jun 13, 2022): @kradalby I won't have time until July to tackle that issue again.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#92