Skip to content
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

--platform can be ignored by what the base image supports #699

Closed
benmoss opened this issue May 5, 2022 · 2 comments · Fixed by #785
Closed

--platform can be ignored by what the base image supports #699

benmoss opened this issue May 5, 2022 · 2 comments · Fixed by #785

Comments

@benmoss
Copy link
Contributor

benmoss commented May 5, 2022

If you have a defaultBaseImage that is an image manifest rather than a image index, it seems that ko will just build for that image's platform, happily ignoring whatever you pass via --platforms.

Repro here: https://github.com/benmoss/wtf-ko

❯ ko build --platform=all .
2022/05/05 10:57:43 Using base gcr.io/distroless/static@sha256:abb120b4ebb4e734dc4c82181bb32b5a4f8bcf78e4540b094b9d59ba7a29a5ad for github.com/benmoss/wtf-ko
2022/05/05 10:57:43 Building github.com/benmoss/wtf-ko for linux/amd64
2022/05/05 10:57:44 Loading kind.local/wtf-ko-3d3e10e27ff19c6d1d54aaa50fb62fd9:843abadc2e51b54f34fe7c0bee50f99c4462593efc183b6867b72573aa0bf572
2022/05/05 10:57:44 Loaded kind.local/wtf-ko-3d3e10e27ff19c6d1d54aaa50fb62fd9:843abadc2e51b54f34fe7c0bee50f99c4462593efc183b6867b72573aa0bf572
2022/05/05 10:57:44 Adding tag latest
2022/05/05 10:57:44 Added tag latest
kind.local/wtf-ko-3d3e10e27ff19c6d1d54aaa50fb62fd9:843abadc2e51b54f34fe7c0bee50f99c4462593efc183b6867b72573aa0bf572
@benmoss
Copy link
Contributor Author

benmoss commented May 5, 2022

--platform=all is actually kind of ambiguous, since I think it tends to mean "build all platforms supported by the base", so this might technically be correct.

This might be a better demonstration of the problem:

❯ ko build --platform=linux/arm64 .
2022/05/05 11:10:52 Using base gcr.io/distroless/static@sha256:abb120b4ebb4e734dc4c82181bb32b5a4f8bcf78e4540b094b9d59ba7a29a5ad for github.com/benmoss/wtf-ko
2022/05/05 11:10:52 Building github.com/benmoss/wtf-ko for linux/amd64
2022/05/05 11:10:52 Loading kind.local/wtf-ko-3d3e10e27ff19c6d1d54aaa50fb62fd9:843abadc2e51b54f34fe7c0bee50f99c4462593efc183b6867b72573aa0bf572
2022/05/05 11:10:53 Loaded kind.local/wtf-ko-3d3e10e27ff19c6d1d54aaa50fb62fd9:843abadc2e51b54f34fe7c0bee50f99c4462593efc183b6867b72573aa0bf572
2022/05/05 11:10:53 Adding tag latest
2022/05/05 11:10:53 Added tag latest
kind.local/wtf-ko-3d3e10e27ff19c6d1d54aaa50fb62fd9:843abadc2e51b54f34fe7c0bee50f99c4462593efc183b6867b72573aa0bf572

@github-actions
Copy link

github-actions bot commented Aug 4, 2022

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. Keep fresh with the 'lifecycle/frozen' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant