.github
Update golangci lint
.gitattributes
enable linter on windows
.golangci.yml
Update golangci lint
compare_test.go
Add OnlyOS function allow matching any architecture
compare.go
Add OnlyOS function allow matching any architecture
cpuinfo_linux_test.go
gofumpt code
cpuinfo_linux.go
gofumpt code
cpuinfo_other.go
gofumpt code
cpuinfo.go
Move to use github.com/containerd/log
database.go
Replace arm64 minor variant logic with lookup table
defaults_darwin.go
Cleanup build constraints
defaults_freebsd.go
platforms: Run goimports for FreeBSD
defaults_test.go
Move windows matcher logic so all platforms can use
defaults_unix_test.go
Add grammar for platform string
defaults_unix.go
Cleanup build constraints
defaults_windows_test.go
Move windows matcher logic so all platforms can use
defaults_windows.go
use windowsMatchComparer for OSVersion match order
defaults.go
Add grammar for platform string
errors.go
platforms: remove errdefs dependency
go.mod
chore(deps): github.com/containerd/log v0.2.0
go.sum
chore(deps): github.com/containerd/log v0.2.0
LICENSE
Add license and readme
platform_windows_compat_test.go
Fix WS2022 compat on hosts past the latest LTSC
platform_windows_compat.go
Fix WS2022 compat on hosts past the latest LTSC
platforms_test.go
modernize --fix
platforms_windows_test.go
replace testify with stdlib in tests
platforms.go
Merge pull request #31 from dmcgowan/windows-strip-features
README.md
fix grammar and highlights in README

platforms

A Go package for formatting, normalizing and matching container platforms.

This package is based on the Open Containers Image Spec definition of a platform.

Platform Specifier

While the OCI platform specifications provide a tool for components to specify structured information, user input typically doesn't need the full context and much can be inferred. To solve this problem, this package introduces "specifiers". A specifier has the format <os>|<arch>|<os>/<arch>[/<variant>]. The user can provide either the operating system or the architecture or both.

An example of a common specifier is linux/amd64. If the host has a default runtime that matches this, the user can simply provide the component that matters. For example, if an image provides amd64 and arm64 support, the operating system, linux can be inferred, so they only have to provide arm64 or amd64. Similar behavior is implemented for operating systems, where the architecture may be known but a runtime may support images from different operating systems.

Project details

platforms is a containerd sub-project, licensed under the Apache 2.0 license. As a containerd sub-project, you will find the:

information in our containerd/project repository.