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

feat: support specifying custom image names #1227

Closed
miguelvr opened this issue Feb 5, 2024 · 1 comment
Closed

feat: support specifying custom image names #1227

miguelvr opened this issue Feb 5, 2024 · 1 comment

Comments

@miguelvr
Copy link

miguelvr commented Feb 5, 2024

Description

Currently, the only way to specify the image name is to rename a folder. Sometimes, the folder name has a generic name that makes sense only within the project context, but not as a global name.

There are 2 workarounds for this, but they both have their disadvantages:

  1. use the full package name for image naming (e.g. github.com/company/repo/cmd/name) → I find this extremely cumbersome, and not particularly readable or easy to manipulate downstream
  2. set KO_DOCKER_REPO to something like registry/repo → this would lead to an image name like repo/name

I find myself using option 2) the most, but I would like to have the freedom to specify custom image names.

Proposal

Note

Flag name and config option name are open to discussion

Use the build id to set the name of the image.

ko build --use-id ./cmd/name

alternatively, allow the user to specify this flag in the configuration, and just use ko build ./cmd/name

builds:
- id: foo
  nameFromID: true
  main: ./cmd/name

This would lead to an image named foo, despite being located in cmd/name

Let me know if the project is open to this proposal, and I'm happy to contribute it

Copy link

github-actions bot commented May 6, 2024

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.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant