summaryrefslogtreecommitdiff
path: root/pkg/platform/platform.go
blob: 380cfd160ec5da9a04446d0d1b6d0eccb9c37873 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Package platform provides helper function to get the runtime architecture
// for different platforms.
package platform // import "github.com/docker/docker/pkg/platform"

import (
	"github.com/sirupsen/logrus"
)

// Architecture holds the runtime architecture of the process.
//
// Unlike [runtime.GOARCH] (which refers to the compiler platform),
// Architecture refers to the running platform.
//
// For example, Architecture reports "x86_64" as architecture, even
// when running a "linux/386" compiled binary on "linux/amd64" hardware.
var Architecture string

func init() {
	var err error
	Architecture, err = runtimeArchitecture()
	if err != nil {
		logrus.WithError(err).Error("Could not read system architecture info")
	}
}