platform_unix.go 439 B

1234567891011121314151617
  1. //go:build !windows
  2. // +build !windows
  3. package platform // import "github.com/docker/docker/pkg/platform"
  4. import (
  5. "golang.org/x/sys/unix"
  6. )
  7. // runtimeArchitecture gets the name of the current architecture (x86, x86_64, i86pc, sun4v, ...)
  8. func runtimeArchitecture() (string, error) {
  9. utsname := &unix.Utsname{}
  10. if err := unix.Uname(utsname); err != nil {
  11. return "", err
  12. }
  13. return unix.ByteSliceToString(utsname.Machine[:]), nil
  14. }