ko icon indicating copy to clipboard operation
ko copied to clipboard

support "scratch" as a special base image

Open mattmoor opened this issue 4 years ago • 9 comments

Something like ko.yaml:

defaultBaseImage: scratch

mattmoor avatar Sep 29 '20 01:09 mattmoor

cc @jonjohnsonjr

I think the hardest part of this now would be determining what to do for --platform=all 🤣

mattmoor avatar Sep 29 '20 01:09 mattmoor

@mattmoor Can I pick this up?

transhapHigsn avatar Oct 10 '20 22:10 transhapHigsn

@transhapHigsn I don't think github reactions generate any notification or email, so I wanted to reply with an explicit "yes" if you are still interested in picking this up.

Using empty.Image from https://godoc.org/github.com/google/go-containerregistry/pkg/v1/empty should be a good place to start.

jonjohnsonjr avatar Nov 10 '20 23:11 jonjohnsonjr

I think we should sort out what we want to do for multi-arch first?

Is there a way to enumerate all of the platform combination the Go toolchain supports? 😅

mattmoor avatar Nov 10 '20 23:11 mattmoor

No mention of GOARM anywhere, so variants would be up to us. Also this is an enormous list (41 combinations) and we should probably not support everything. Would be a good use case for comma-separated --platform or we could warn if --platform=all and the base is scratch.

$ go tool dist list -json
[
        {
                "GOOS": "aix",
                "GOARCH": "ppc64",
                "CgoSupported": true
        },
        {
                "GOOS": "android",
                "GOARCH": "386",
                "CgoSupported": true
        },
        {
                "GOOS": "android",
                "GOARCH": "amd64",
                "CgoSupported": true
        },
        {
                "GOOS": "android",
                "GOARCH": "arm",
                "CgoSupported": true
        },
        {
                "GOOS": "android",
                "GOARCH": "arm64",
                "CgoSupported": true
        },
        {
                "GOOS": "darwin",
                "GOARCH": "amd64",
                "CgoSupported": true
        },
        {
                "GOOS": "darwin",
                "GOARCH": "arm64",
                "CgoSupported": true
        },
        {
                "GOOS": "dragonfly",
                "GOARCH": "amd64",
                "CgoSupported": true
        },
        {
                "GOOS": "freebsd",
                "GOARCH": "386",
                "CgoSupported": true
        },
        {
                "GOOS": "freebsd",
                "GOARCH": "amd64",
                "CgoSupported": true
        },
        {
                "GOOS": "freebsd",
                "GOARCH": "arm",
                "CgoSupported": true
        },
        {
                "GOOS": "freebsd",
                "GOARCH": "arm64",
                "CgoSupported": true
        },
        {
                "GOOS": "illumos",
                "GOARCH": "amd64",
                "CgoSupported": true
        },
        {
                "GOOS": "js",
                "GOARCH": "wasm",
                "CgoSupported": false
        },
        {
                "GOOS": "linux",
                "GOARCH": "386",
                "CgoSupported": true
        },
        {
                "GOOS": "linux",
                "GOARCH": "amd64",
                "CgoSupported": true
        },
        {
                "GOOS": "linux",
                "GOARCH": "arm",
                "CgoSupported": true
        },
        {
                "GOOS": "linux",
                "GOARCH": "arm64",
                "CgoSupported": true
        },
        {
                "GOOS": "linux",
                "GOARCH": "mips",
                "CgoSupported": true
        },
        {
                "GOOS": "linux",
                "GOARCH": "mips64",
                "CgoSupported": true
        },
        {
                "GOOS": "linux",
                "GOARCH": "mips64le",
                "CgoSupported": true
        },
        {
                "GOOS": "linux",
                "GOARCH": "mipsle",
                "CgoSupported": true
        },
        {
                "GOOS": "linux",
                "GOARCH": "ppc64",
                "CgoSupported": false
        },
        {
                "GOOS": "linux",
                "GOARCH": "ppc64le",
                "CgoSupported": true
        },
        {
                "GOOS": "linux",
                "GOARCH": "riscv64",
                "CgoSupported": false
        },
        {
                "GOOS": "linux",
                "GOARCH": "s390x",
                "CgoSupported": true
        },
        {
                "GOOS": "netbsd",
                "GOARCH": "386",
                "CgoSupported": true
        },
        {
                "GOOS": "netbsd",
                "GOARCH": "amd64",
                "CgoSupported": true
        },
        {
                "GOOS": "netbsd",
                "GOARCH": "arm",
                "CgoSupported": true
        },
        {
                "GOOS": "netbsd",
                "GOARCH": "arm64",
                "CgoSupported": true
        },
        {
                "GOOS": "openbsd",
                "GOARCH": "386",
                "CgoSupported": true
        },
        {
                "GOOS": "openbsd",
                "GOARCH": "amd64",
                "CgoSupported": true
        },
        {
                "GOOS": "openbsd",
                "GOARCH": "arm",
                "CgoSupported": true
        },
        {
                "GOOS": "openbsd",
                "GOARCH": "arm64",
                "CgoSupported": true
        },
        {
                "GOOS": "plan9",
                "GOARCH": "386",
                "CgoSupported": false
        },
        {
                "GOOS": "plan9",
                "GOARCH": "amd64",
                "CgoSupported": false
        },
        {
                "GOOS": "plan9",
                "GOARCH": "arm",
                "CgoSupported": false
        },
        {
                "GOOS": "solaris",
                "GOARCH": "amd64",
                "CgoSupported": true
        },
        {
                "GOOS": "windows",
                "GOARCH": "386",
                "CgoSupported": true
        },
        {
                "GOOS": "windows",
                "GOARCH": "amd64",
                "CgoSupported": true
        },
        {
                "GOOS": "windows",
                "GOARCH": "arm",
                "CgoSupported": false
        }
]

jonjohnsonjr avatar Nov 10 '20 23:11 jonjohnsonjr

Challenge accepted? 😅

mattmoor avatar Nov 10 '20 23:11 mattmoor

Would love to see how you plan to test your plan9/386 container images.

jonjohnsonjr avatar Nov 10 '20 23:11 jonjohnsonjr

@transhapHigsn I don't think github reactions generate any notification or email, so I wanted to reply with an explicit "yes" if you are still interested in picking this up.

Using empty.Image from https://godoc.org/github.com/google/go-containerregistry/pkg/v1/empty should be a good place to start.

@mattmoor Sorry, I had some problems related to notifications. Found this out today.

transhapHigsn avatar Nov 12 '20 08:11 transhapHigsn

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Feb 11 '21 01:02 github-actions[bot]