File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ package embeddedpostgres
22
33import (
44 "os"
5+ "os/exec"
56 "runtime"
7+ "strings"
68)
79
810// VersionStrategy provides a strategy that can be used to determine which version of Postgres should be used based on
@@ -14,8 +16,24 @@ func defaultVersionStrategy(config Config) VersionStrategy {
1416 goos := runtime .GOOS
1517 arch := runtime .GOARCH
1618
17- // use alpine specific build
1819 if goos == "linux" {
20+ // the zonkyio/embedded-postgres-binaries project produces
21+ // arm binaries with the following name schema:
22+ // 32bit: arm32v6 / arm32v7
23+ // 64bit (aarch64): arm64v8
24+ if arch == "arm64" {
25+ arch += "v8"
26+ } else if arch == "arm" {
27+ if out , err := exec .Command ("uname" , "-m" ).Output (); err == nil {
28+ s := string (out )
29+ if strings .HasPrefix (s , "armv7" ) {
30+ arch += "32v7"
31+ } else if strings .HasPrefix (s , "armv6" ) {
32+ arch += "32v6"
33+ }
34+ }
35+ }
36+ // check alpine specific build
1937 if _ , err := os .Stat ("/etc/alpine-release" ); err == nil {
2038 arch += "-alpine"
2139 }
You can’t perform that action at this time.
0 commit comments