-
Notifications
You must be signed in to change notification settings - Fork 403
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
Consider adding an equivalence of EXPOSE #472
Comments
I have no particular problem with this. I wonder how we'd like to let users configure this. In |
The (adding another section with per-importpath configs seems error prone and may be confusing too) |
I would like to get @caarlos0 to weigh in on some things, maybe. IMO, if we can expose enough config like this to reasonably tell someone "you really don't need a Dockerfile", it wouldn't be a bad idea for goreleaser to use However, I'd like to avoid collisions within their config, and by borrowing their config format, it's on us to make sure we don't cause any collisions. First thoughts that come to mind:
Basically just overlay the config file as yaml atop whatever ko builds so you can override anything. What's annoying is that this should maybe be:
Because the config file has a We could also have a parallel structure:
Or something? |
I'm not well versed in ko, but I would think that it depends on wether you want to allow to create an image with several builds in it... if yes, I would go with something like: builds:
- id: foo
main: ./foobar/foo
- id: bar
main: ./foobar/bar
containers:
- id: foobar
builds: [foo, bar] # or maybe `ids`?
manifest:
# options here... very inspired in how we currently link things in goreleaser... fwiw, I was thinking in how to best integrate ko with goreleaser as well, and I think having another high level config + using the same syntax for builds would allow to basically "include" the ko.yaml into goreleaser.yaml, but that's maybe another thread... happy to discuss it somewhere else if it interests you as well :) |
This might be a way to tackle #251
Can you elaborate on this a bit?
Yeah that's definitely the overall goal in my mind -- just merge the two files (maybe a symlink) if at all possible.
100% yes, there's a |
Currently goreleaser builds the binaries locally already (and the build config is very similar to ko's)... Let's say we go with another high-level entry for the EXPOSE et all (e.g. builds:
- id: foo
main: ./foobar/foo
- id: bar
main: ./foobar/bar
containers:
- id: foobar
builds: [foo, bar] # or maybe `ids`?
manifest:
# options here... Then, lets say you want to use goreleaser to manage other stuff as well, IF configs are compatible, it would be basically at least, that was my general idea... 🤔 |
Yep yep, 100% this is the goal. Given that goreleaser does an excellent job of exposing everything you might need to configure for a go build, we just stole it rather than reinventing the wheel. As long as goreleaser is able to ignore unknown fields (e.g. the ko config), you should be able to use the same config file for both tools. One kind of strange bit is that I think this makes things a little weird, and also some ko-isms like bundling (Probably time to pull this into a separate issue...) |
the build is logic is already more or less isolated: https://github.com/goreleaser/goreleaser/tree/master/internal/builders/golang there are a few internal dependencies ( |
This issue is stale because it has been open for 90 days with no |
Coming here to comment that when using tools like Knative without the |
Per https://docs.docker.com/engine/reference/builder/#expose:
Some container service (like Azure App Service) consumes this metadata to automatically configure the correct port-mapping to the container. Without this metadata, users of these service will need to set this on the deployment side.
cc @jonjohnsonjr
The text was updated successfully, but these errors were encountered: