1
0
Fork 0
mirror of https://github.com/imjasonh/combine synced 2026-07-08 04:44:52 +00:00

add crane exampleg

This commit is contained in:
Jason Hall 2021-06-08 10:47:46 -04:00
parent 6391788f43
commit 58477c7ad2

View file

@ -7,7 +7,7 @@ It fails if both images provide the same platforms, or if either isn't a manifes
# demo # demo
``` ```
go run ./ \ $ go run ./ \
gcr.io/distroless/static:nonroot \ gcr.io/distroless/static:nonroot \
mcr.microsoft.com/windows/nanoserver:1809 \ mcr.microsoft.com/windows/nanoserver:1809 \
gcr.io/imjasonh/combined gcr.io/imjasonh/combined
@ -15,5 +15,41 @@ go run ./ \
This combines the [distroless](https://github.com/googlecontainertools/distroless) image providing linux platform support with an image providing Windows support. This combines the [distroless](https://github.com/googlecontainertools/distroless) image providing linux platform support with an image providing Windows support.
You can check the image's platforms using [`crane`](https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md):
```
$ 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. 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. 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.