arch

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArchBaseImages = map[KnownArch]map[string]string{
	ARMV8: {
		"library/debian":    "arm64v8/debian",
		"library/alpine":    "arm64v8/alpine",
		"library/php":       "arm64v8/php",
		"library/ubuntu":    "arm64v8/ubuntu",
		"library/wordpress": "arm64v8/wordpress",
		"library/busybox":   "arm64v8/busybox",
		"library/ruby":      "arm64v8/ruby",
		"library/httpd":     "arm64v8/httpd",
		"library/fedora":    "arm64v8/fedora",
	},
	ARMV7: {
		"library/opensuse":    "arm32v7/opensuse",
		"library/ubuntu":      "arm32v7/ubuntu",
		"library/alpine":      "container4armhf/armhf-alpine",
		"library/busybox":     "container4armhf/armhf-busybox",
		"library/archlinux":   "armv7/armhf-archlinux",
		"library/debian":      "armbuild/debian",
		"gentoo/stage3-amd64": "paralin/gentoo-stage3-armv7a",
	},
	ARMV6: {
		"library/alpine":   "arm32v6/alpine",
		"library/openjdk":  "arm32v6/openjdk",
		"library/tomcat":   "arm32v6/tomcat",
		"library/bash":     "arm32v6/bash",
		"library/golang":   "arm32v6/golang",
		"library/postgres": "arm32v6/postgres",
		"library/haproxy":  "arm32v6/haproxy",
		"library/busybox":  "arm32v6/busybox",
	},
}

ArchBaseImages lists known compatible equivalents for amd64 images on other arches.

View Source
var KnownArchCompat = map[KnownArch][]KnownArch{

	ARMV8: {ARMV6, ARMV7},

	ARMV7: {ARMV6},
}

KnownArchCompat contains known compatibilities between architectures.

View Source
var KnownArchNames = map[string]KnownArch{
	"arm":     ARMV6,
	"armv6l":  ARMV6,
	"armv7l":  ARMV7,
	"aarch64": ARMV8,
	"armv8*":  ARMV8,

	"x86_64": AMD64,
	"amd64":  AMD64,
	"i386":   AMD64,
}

KnownArchNames are the string regex representations of KnownArch.

Functions

func CompatibleBaseImage

func CompatibleBaseImage(targetArch KnownArch, image string) (string, bool)

CompatibleBaseImage checks for a equivalent/compatible image for a target platform.

Types

type KnownArch

type KnownArch int

KnownArch represents a known architecture.

const (
	NONE KnownArch = iota
	// AMD64 architecture.
	AMD64
	// ARMv6 architecture.
	ARMV6
	// ARMv7 architecture.
	ARMV7
	// ARMv8 64-bit ARM architecture.
	ARMV8
)
var DefaultArch KnownArch = AMD64

DefaultArch is the architecture most Docker images are compatible with on default.

func ParseArch

func ParseArch(arch string) (KnownArch, bool)

ParseArch attempts to determine which arch the (uname -m) output represents.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL