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:
parent
2ba70fc75b
commit
96bedf16df
3
.github/workflows/e2e.yaml
vendored
3
.github/workflows/e2e.yaml
vendored
@ -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
2
.ko.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
baseImageOverrides:
|
||||
github.com/google/ko: golang:1.17
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user