As the development team uses both Intel and Apple Silicon Macs, we have to get the host CPU architecture at compilation time instead of harcoding it. If the container has a different architecture, the guest has to be emulated.
9 lines
172 B
Swift
9 lines
172 B
Swift
struct Docker {
|
|
static func getLinuxPlatformStringWithHostArchitecture() -> String {
|
|
#if arch(x86_64)
|
|
return "linux/amd64"
|
|
#else
|
|
return "linux/arm64"
|
|
#endif
|
|
}
|
|
} |