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

[FEATURE] Support integration with CI/CD pipelines #10

Open
duaraghav8 opened this issue Dec 7, 2024 · 2 comments
Open

[FEATURE] Support integration with CI/CD pipelines #10

duaraghav8 opened this issue Dec 7, 2024 · 2 comments
Labels
feature-request Feature request priority High priority issue

Comments

@duaraghav8
Copy link
Owner

Is your feature request related to a problem you're facing?
I don't know for sure whether dockershrink can work well with CI/CD pipelines today or not.
One thing it does take care of is to exit with code 0 in case of success and non-0 in case of failures.
But how do we treat warnings? Recommendations? Needs to be discussed

Describe the solution you'd like
Ideally, a user must be able to integrate dockershrink into their container image-building pipeline (before running docker build or equivalents).
If dockershrink could not find ANY optimizations to make, the pipeline should proceed.
But if optimizations are possible, it must fail the build pipeline or at least produce a warning (configurable by user).

Optionally describe alternatives you've considered
Run the tool locally to optimize the image. Only when DS no longer has anything to change do I push the code and begin building process.

@duaraghav8 duaraghav8 added the feature-request Feature request label Dec 7, 2024
@rssnyder
Copy link

But if optimizations are possible, it must fail the build pipeline or at least produce a warning (configurable by user).

Sounds like you would need a -check command which would return non-0 in the case that optimization was possible, and 0 otherwise. Then in your pipeline simply have a step that runs dockershrink -check.

We do this today with tofu fmt -check

@duaraghav8
Copy link
Owner Author

Agreed, this is the behavior required.
Regarding the name of the flag, I also like something like --ci (dockershrink optimize --ci), simply because it is easier to guess the purpose of this option

@duaraghav8 duaraghav8 added the priority High priority issue label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Feature request priority High priority issue
Projects
None yet
Development

No branches or pull requests

2 participants