1
0
mirror of https://github.com/ko-build/ko.git synced 2024-11-27 08:21:07 +02:00

Add .ko.yaml to base ko container image on golang:1.17 (#533)

* Add .ko.yaml to base ko container image on golang:1.17

Ignore this in e2e tests, since even though golang:1.17 provides a
Windows base image, ko's base image platform selection doesn't take
osversion into account. The e2e tests don't exercise golang usage at
all, so it shouldn't matter.

* Update README
This commit is contained in:
Jason Hall 2021-12-14 12:56:21 -05:00 committed by GitHub
parent 2ba70fc75b
commit 96bedf16df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -33,6 +33,9 @@ jobs:
eval $(go env | sed -r 's/^(set )?(\w+)=("?)(.*)\3$/\2="\4"/gm')
if [[ "${{ matrix.platform }}" == "windows-latest" ]]; then
# Always use the nanoserver base image, which matches the Windows
# version used by the GitHub Actions Windows runner.
rm .ko.yaml
export KO_DEFAULTBASEIMAGE=mcr.microsoft.com/windows/nanoserver:1809
fi

2
.ko.yaml Normal file
View File

@ -0,0 +1,2 @@
baseImageOverrides:
github.com/google/ko: golang:1.17

View File

@ -466,9 +466,11 @@ You can try out building a Windows container image by [setting the base image](#
For example, to build a Windows container image for `ko`, from within this repo:
```
KO_DEFAULTBASEIMAGE=mcr.microsoft.com/windows/nanoserver:1809 ko publish ./ --platform=windows/amd64
ko publish ./ --platform=windows/amd64
```
This works because the `ko` image is configured in [`.ko.yaml`](./.ko.yaml) to be based on a `golang` base image, which provides platform-specific images for both Linux and Windows.
### Known issues 🐛
- Symlinks in `kodata` are ignored when building Windows images; only regular files and directories will be included in the Windows image.