combine

command
v0.0.0-...-bf07e66 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

README

combine manifest lists

This tool combines two or more Docker manifest lists ("multi-arch images") into one that provides all the platforms supported by all the specified base image manifest lists.

It fails if any images provide the same platforms, or if any isn't a manifest list.

demo

$ go run ./ \
    ghcr.io/distroless/static \
    mcr.microsoft.com/windows/nanoserver:ltsc2022 \
    mcr.microsoft.com/windows/nanoserver:ltsc2019 \
    gcr.io/MY_PROJECT/combined

This combines a distroless base image providing Linux platform support, with two image providing different versions of a Windows base image.

The general form of the command args is:

combine src1 src2 [src...] dst

(combine two or more source manifest lists and push to the dst reference).

After running the script, you can check the image's platforms using crane:

$ crane manifest gcr.io/MY_PROJECT/combined | jq '.manifests[].platform'
{
  "architecture": "386",
  "os": "linux"
}
{
  "architecture": "amd64",
  "os": "linux"
}
{
  "architecture": "arm",
  "os": "linux",
  "variant": "v6"
}
{
  "architecture": "arm",
  "os": "linux",
  "variant": "v7"
}
{
  "architecture": "arm64",
  "os": "linux"
}
{
  "architecture": "ppc64le",
  "os": "linux"
}
{
  "architecture": "riscv64",
  "os": "linux"
}
{
  "architecture": "s390x",
  "os": "linux"
}
{
  "architecture": "amd64",
  "os": "windows",
  "os.version": "10.0.20348.887"
}
{
  "architecture": "amd64",
  "os": "windows",
  "os.version": "10.0.17763.3287"
}

The result is an image that provides support for all the provided base image platforms. If any manifest lists provide duplicate support for the same platform, the script will fail.

This image is intended to be suitable as a base image used with ko to provide multi-arch and multi-OS support for a Go application.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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