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 {
|
func SupportedPlatforms() []string {
|
||||||
once.Do(func() {
|
once.Do(func() {
|
||||||
def := platforms.DefaultString()
|
def := defaultPlatform()
|
||||||
arr = append(arr, def)
|
arr = append(arr, def)
|
||||||
if p := "linux/amd64"; def != p && amd64Supported() == nil {
|
if p := "linux/amd64"; def != p && amd64Supported() == nil {
|
||||||
arr = append(arr, p)
|
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 end user could fix the issue based on those warning, and thus no need to drop
|
||||||
//the platform from the candidates.
|
//the platform from the candidates.
|
||||||
func WarnIfUnsupported(pfs []string) {
|
func WarnIfUnsupported(pfs []string) {
|
||||||
def := platforms.DefaultString()
|
def := defaultPlatform()
|
||||||
for _, p := range pfs {
|
for _, p := range pfs {
|
||||||
if p != def {
|
if p != def {
|
||||||
if p == "linux/amd64" {
|
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) {
|
func printPlatfromWarning(p string, err error) {
|
||||||
if strings.Contains(err.Error(), "exec format 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)
|
logrus.Warnf("platform %s cannot pass the validation, kernel support for miscellaneous binary may have not enabled.", p)
|
||||||
|
|
Loading…
Reference in New Issue