Use docker info to get arch
This commit is contained in:
@@ -29,9 +29,7 @@ class Kamal::Configuration::Builder
|
||||
|
||||
def local_arches
|
||||
@local_arches ||= if remote
|
||||
uname_m = `uname -m`.strip
|
||||
local_arch = uname_m == "x86_64" ? "amd64" : uname_m
|
||||
arches & [ local_arch ]
|
||||
arches & [ Kamal::Utils.docker_arch ]
|
||||
else
|
||||
arches
|
||||
end
|
||||
|
||||
@@ -81,4 +81,16 @@ module Kamal::Utils
|
||||
def join_commands(commands)
|
||||
commands.map(&:strip).join(" ")
|
||||
end
|
||||
|
||||
def docker_arch
|
||||
arch = `docker info --format '{{.Architecture}}'`.strip
|
||||
case arch
|
||||
when /aarch64/
|
||||
"arm64"
|
||||
when /x86_64/
|
||||
"amd64"
|
||||
else
|
||||
arch
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user