1
0
Fork 0
mirror of https://github.com/imjasonh/combine synced 2026-07-06 20:02:20 +00:00
No description
Find a file
2021-06-08 10:47:46 -04:00
go.mod initial commit 2021-06-08 10:44:26 -04:00
go.sum initial commit 2021-06-08 10:44:26 -04:00
main.go initial commit 2021-06-08 10:44:26 -04:00
README.md add crane exampleg 2021-06-08 10:47:46 -04:00

combine manifest lists

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

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

demo

$ go run ./ \
    gcr.io/distroless/static:nonroot \
    mcr.microsoft.com/windows/nanoserver:1809 \
    gcr.io/imjasonh/combined

This combines the distroless image providing linux platform support with an image providing Windows support.

You can check the image's platforms using crane:

$ crane manifest gcr.io/imjasonh/combined | jq '.manifests[].platform'
{
  "architecture": "amd64",
  "os": "linux"
}
{
  "architecture": "arm",
  "os": "linux"
}
{
  "architecture": "arm64",
  "os": "linux"
}
{
  "architecture": "ppc64le",
  "os": "linux"
}
{
  "architecture": "s390x",
  "os": "linux"
}
{
  "architecture": "amd64",
  "os": "windows",
  "os.version": "10.0.17763.1935"
}
{
  "architecture": "arm",
  "os": "windows",
  "os.version": "10.0.17763.1935"
}

The result is an image that provides support for both. 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.