docker: switch away from Nix to build Docker images

This should be faster to build multiarch images, as Nix requires
emulation, while we can build everything natively using builtin Go
cross-compilation support. Moreover, caching should be better.

Also, add Nix build to CI.

Also, build more architectures (linux/arm/v7).
This commit is contained in:
Vincent Bernat
2025-08-04 11:16:37 +02:00
parent d930bbaa71
commit 268e95ee18
7 changed files with 95 additions and 21 deletions

View File

@@ -7,6 +7,7 @@ import (
"bytes"
"fmt"
"runtime"
"slices"
"strings"
"testing"
@@ -26,10 +27,18 @@ func TestVersion(t *testing.T) {
want := []string{
"akvorado dev",
fmt.Sprintf(" Built with: %s", runtime.Version()),
fmt.Sprintf(" Build setting GOARCH=%s", runtime.GOARCH),
fmt.Sprintf(" Build setting GOOS=%s", runtime.GOOS),
"",
}
got := strings.Split(buf.String(), "\n")[:len(want)]
if diff := helpers.Diff(got, want); diff != "" {
got := strings.Split(buf.String(), "\n")
got = slices.DeleteFunc(got, func(s string) bool {
return strings.HasPrefix(s, " Build setting") &&
!strings.HasPrefix(s, " Build setting GOOS") &&
!strings.HasPrefix(s, " Build setting GOARCH")
})
if diff := helpers.Diff(got[:len(want)], want); diff != "" {
t.Errorf("`version` (-got, +want):\n%s", diff)
}
}