-
Notifications
You must be signed in to change notification settings - Fork 293
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
Enable package-buildpack for windows #840
Merged
jromero
merged 4 commits into
buildpacks:main
from
aemengo:feature/windows-package-buildpack-172289412
Oct 20, 2020
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there's a way to infer this without a flag... I understand why we might not want to look at the dockerhost OS, as you might be cross-building. Though wouldn't that only work in a
--publish
scenario?Back to the original question, is there some way we could derive this from the buildpack? Seems unlikely but thought I'd ask.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a good thing to discuss. Right now, for backward compatibility reasons, this implementation does still always default to
linux
for--publish
or--format=file
w/o the--os
flag (it emits a warning telling you this) but for local images (which is the default forpackage-buildpack
w/o options) it will autodetect the image type (without a warning) and save it on the dameon. Also for backward compatibility, it can't require a daemon for--publish
or--format=file
.With that in mind, the autodetection options for
--publish
or--format=file
might be to detect based on a optional daemon, but depending on if your daemon is running/stopped, you have a reachable/unreachableDOCKER_HOST
set, or some other environment difference, you'd generate different images with the same command. I feel like autodetecting the image type from the dameon only really feels right in the case of a local image on the daemon, where it has to match the running daemon anyways and it unlikely to be pushed up to a registry or copied around.Detecting from a buildpack would be hard as meta buildpacks wouldn't even have binary names to check
bin/build
vsbin/build{.bat,.exe}
. We'd need each buildpack in the package to explicitly state that they are Windows and them all to agree.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could make the
os
an optional field in the package config though, instead of the--os
flag. Thenpackage-buildpack
would consistently generate the same image time regardless of daemon. The only potential catch there is that to-date, the package config tends to describe CNB-related things (buildpack paths and images) inside a package and not things about the way it's packaged (ex:--format
is specified on the command line, not in thepackage.toml
).