Merge pull request #946 from tonistiigi/arm64-detect
binfmt_misc: detect arm64 properlydocker-19.03
commit
6085a25a2f
|
@ -13,7 +13,7 @@ var arr []string
|
|||
|
||||
func SupportedPlatforms() []string {
|
||||
once.Do(func() {
|
||||
def := platforms.DefaultString()
|
||||
def := defaultPlatform()
|
||||
arr = append(arr, def)
|
||||
if p := "linux/amd64"; def != p && amd64Supported() == nil {
|
||||
arr = append(arr, p)
|
||||
|
@ -34,7 +34,7 @@ func SupportedPlatforms() []string {
|
|||
//the end user could fix the issue based on those warning, and thus no need to drop
|
||||
//the platform from the candidates.
|
||||
func WarnIfUnsupported(pfs []string) {
|
||||
def := platforms.DefaultString()
|
||||
def := defaultPlatform()
|
||||
for _, p := range pfs {
|
||||
if p != def {
|
||||
if p == "linux/amd64" {
|
||||
|
@ -56,6 +56,10 @@ func WarnIfUnsupported(pfs []string) {
|
|||
}
|
||||
}
|
||||
|
||||
func defaultPlatform() string {
|
||||
return platforms.Format(platforms.Normalize(platforms.DefaultSpec()))
|
||||
}
|
||||
|
||||
func printPlatfromWarning(p string, err error) {
|
||||
if strings.Contains(err.Error(), "exec format error") {
|
||||
logrus.Warnf("platform %s cannot pass the validation, kernel support for miscellaneous binary may have not enabled.", p)
|
||||
|
|
Loading…
Reference in New Issue