-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider allowing base image selection based on platform #475
Comments
This is exactly what Tekton plans to do, stitching together distroless+Windows with https://github.com/tektoncd/plumbing/tree/main/cmd/combine I'd be willing to entertain ideas about how ko could support this better without other tools, if you have any ideas I'm all ears. 👂 |
I don't know how How about in
When a variant is provided by more than one base image we will only consider the first one. |
I played around with this a bit at main...imjasonh:combine-base-images Basically, allowing
Manifest JSON``` { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", "manifests": [ { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 752, "digest": "sha256:657997de10efe5a246843ecdf425fe8c1046ee2bf78e8f55658d7e393f8c04b4", "platform": { "architecture": "amd64", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 752, "digest": "sha256:7ea5ce75ebdf3116a92cc8977e351a9f8b2045c4985be7f82c122b66cb12ae66", "platform": { "architecture": "arm", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 752, "digest": "sha256:f78a9c33ce8aaa25bdecac1433e07cdfb6da2a15b6bcf19232388d114456947a", "platform": { "architecture": "arm64", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 752, "digest": "sha256:7818321e8eefeec9287aca8f79ed02105bb93fe697b8901544d3ce4e61b3e85f", "platform": { "architecture": "ppc64le", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 752, "digest": "sha256:fe3cc4ca545b467b12e960cb9d5529c7209463bf032b61cac703ed34e282337d", "platform": { "architecture": "s390x", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 898, "digest": "sha256:6dc63b502c86e16f033ba03f9d815e1744ee0396c77d93a3458a42ad66038956", "platform": { "architecture": "amd64", "os": "windows", "os.version": "10.0.17763.2237" } } ] } ```One thing that breaks is setting base image annotations (#221) since there are now multiple bases, or depending on how you think about it, the base is an ephemeral index that doesn't exist except during build-time. I'm not really sure how to address that, or if this points to a fundamental issue with doing this this way. |
This is very awesome. Thanks a lot for hacking this!
I see, in Can we push two images:
However if we do this we are just simulating |
I don't have anything to add here, beside that I now would prefer the approach of building the base image separately now. I'm closing the issue. Please feel free to reopen if you have something in mind. Thanks a lot for prototyping and taking the time to explain! |
Currently I wasn't able to find a base image that has both Windows and Linux. I am considering stitching the official Windows image with distroless to have such a base image. However, a user going down that path will need to maintain this stitching themselves.
Would it be bad for
ko
to allow selecting base image based on platform? Then with a couple more lines in.ko.yaml
,ko publish --platform=all
will easily 3x its OS x ARCH combination.The text was updated successfully, but these errors were encountered: