jib icon indicating copy to clipboard operation
jib copied to clipboard

Enable to customize history steps?

Open rmannibucau opened this issue 2 years ago • 5 comments

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

rmannibucau avatar Feb 22 '23 18:02 rmannibucau

@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

mpeddada1 avatar Feb 24 '23 21:02 mpeddada1

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.

rmannibucau avatar Feb 25 '23 08:02 rmannibucau

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?

mpeddada1 avatar Aug 25 '23 20:08 mpeddada1

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.

rmannibucau avatar Aug 26 '23 06:08 rmannibucau

Got it! That helps, thank you.

mpeddada1 avatar Aug 31 '23 17:08 mpeddada1