2017-11-01 19:37:53 -04:00
|
|
|
// +build freebsd darwin
|
2016-03-25 19:38:00 -04:00
|
|
|
|
2016-05-03 12:10:21 -04:00
|
|
|
// Package platform provides helper function to get the runtime architecture
|
|
|
|
// for different platforms.
|
2018-02-05 16:05:59 -05:00
|
|
|
package platform // import "github.com/docker/docker/pkg/platform"
|
2016-03-25 19:38:00 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os/exec"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2016-05-03 12:10:21 -04:00
|
|
|
// runtimeArchitecture gets the name of the current architecture (x86, x86_64, i86pc, sun4v, ...)
|
2016-03-25 19:38:00 -04:00
|
|
|
func runtimeArchitecture() (string, error) {
|
|
|
|
cmd := exec.Command("/usr/bin/uname", "-m")
|
|
|
|
machine, err := cmd.Output()
|
|
|
|
if err != nil {
|
|
|
|
return "", err
|
|
|
|
}
|
|
|
|
return strings.TrimSpace(string(machine)), nil
|
|
|
|
}
|