ko icon indicating copy to clipboard operation
ko copied to clipboard

Allow setting `KO_DOCKER_REPO` in `.ko.yaml`

Open embano1 opened this issue 2 years ago • 12 comments

Based on a Twitter conversation, it was raised whether KO_DOCKER_REPO should also be a configuration option in .ko.yaml (mainly for consistency purposes).

IMHO since this is not a build but publish option, it might have to go in PublishOptions parsing (related: #351).

embano1 avatar Mar 01 '22 13:03 embano1

will you work on that @embano1? 🙋🏻‍♂️

developer-guy avatar Mar 01 '22 13:03 developer-guy

@imjasonh maybe we can do both https://github.com/google/ko/issues/626, WDYT, if you agree, I'm willing to do this one too

developer-guy avatar Mar 02 '22 17:03 developer-guy

Sure!

My only real question is what do we want it to look like in .ko.yaml? A new top-level repo: field? Something else? Give me your ideas!

imjasonh avatar Mar 02 '22 18:03 imjasonh

Initially I thought a top-level string:string field would work, e.g. imageRepository: myrepository.somewhere.out.

Then I thought, how likely is it that multiple images should be pushed to different registries/locations? I.e. something similar we do with baseImageOverride and build for different binaries?

embano1 avatar Mar 04 '22 08:03 embano1

hello @embano1, you can keep up the process from here, please feel free to add your comments to the PR. 🙋🏻‍♂️

developer-guy avatar Mar 04 '22 09:03 developer-guy

Then I thought, how likely is it that multiple images should be pushed to different registries/locations?

ko doesn't support this at all today. In the spirit of not scope-creeping this, I'd like to maintain something like the current behavior, and just push to a single repo per ko invocation.

imjasonh avatar Mar 04 '22 13:03 imjasonh

Hw about tags? Can they also be included in the .ko.yaml file to tag each build individually? Shall I create a tracking issue for this or there's a reason for not doing that?

laurentsimon avatar Apr 13 '22 23:04 laurentsimon

What's your use case for wanting each image in a ko resolve to get different tags? 🤔

The typical use case for tags is associating images with a release (:v1.2.3), which generally means all the images in a set of images should have the same tag.

imjasonh avatar Apr 14 '22 14:04 imjasonh

oops, sorry. I'm interested in different tags for ko publish only. I was hoping I could generate/push multiple images with distinct tags.

laurentsimon avatar Apr 14 '22 16:04 laurentsimon

oops, sorry. I'm interested in different tags for ko publish only. I was hoping I could generate/push multiple images with distinct tags.

ko build only builds one image today (at least until https://github.com/google/ko/pull/644 lands), and even when it doesn't I think I'd like to recommend that all invocations produce the same tags, for more or less the same reason as ko resolve does today.

You can already ko build ./ -t foo -t bar to produce one image with both :foo and :bar, but I don't think I want to support any situation where tags are selectively applied to images without a strong indication of the use case.

imjasonh avatar Apr 14 '22 17:04 imjasonh

kindly ping @imjasonh

developer-guy avatar May 09 '22 15:05 developer-guy

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[bot] avatar Aug 08 '22 01:08 github-actions[bot]