GoogleContainerTools / jib

🏗 Build container images for your Java applications.
Apache License 2.0
13.68k stars 1.44k forks source link

Enable to customize history steps? #3938

Open rmannibucau opened 1 year ago

rmannibucau commented 1 year ago

Hi,

I just realized jib history is filled using tool name (created_by) which sounds ok but this array (history) is used to show the steps most of the time so it should container the data related to the layer. One common issue is that if you create 3 layers with jib you get 3 times the same "jib" data and no info on what is done in the step. As of today I think there is only a global string per container build and not one per layer, would it be possible to make it more flexible to be able to use UI reading these data?

Romain

mpeddada1 commented 1 year ago

@rmannibucau Perhaps I'm misunderstanding the use case here. In addition to the tool name and version in created_by, jib also provides information on the application layers as a comment (can be checked with docker history {image_name}). Please see: https://github.com/GoogleContainerTools/jib/blob/e183448d5142573f5b0549cef5f24e6859c87890/jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/BuildImageStep.java#L126-L132

rmannibucau commented 1 year ago

Hi,

Yes, seems it does not work with gitea (https://github.com/go-gitea/gitea/blob/main/modules/packages/container/metadata.go#L93) which ignores the comment and only uses the created by because there is no "#(nop) " string in comments. Didnt check docker/podman but the related images work so wonder if jib should format provided steing differently. Overall idea is to mark command in comment and ignore plain comments I think to show build history rather than human comments in the ui.

mpeddada1 commented 1 year ago

Thanks for the context! Marking this issue as an enhancement but so that we gain a better understanding of the change proposed, @rmannibucau would you be able to provide a concrete scenario/use case of when this could be used?

rmannibucau commented 1 year ago

Basically it would be enabled by default as docker/podman do and to validate you can run gitea with docker or minikube (there is a helm recipe), create an orga, push a container and check the container detail page in the ui (https://docs.gitea.com/next/usage/packages/container). Steps should be as readable than if you pushed an image with docker or podman.

Hope it helps.

mpeddada1 commented 1 year ago

Got it! That helps, thank you.