slimtoolkit / slim

Slim(toolkit): Don't change anything in your container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)
Apache License 2.0
19.41k stars 728 forks source link

Read Config from YML File #239

Open ProfessorManhattan opened 2 years ago

ProfessorManhattan commented 2 years ago

In some cases, I get these really long unwieldy build strings that are difficult to manage. Also, in many cases, there are parameters that are repeated across different builds (e.g. including git or jq). I was thinking it would be great if we could store our build config for each build in a YML file. Are there already plans to support this? If not, I was thinking about writing a supplementary NPM package that would handle this for us.

Just looking for any ideas/recommendations before I write something that no one ends up using.

kcq commented 2 years ago

@ProfessorManhattan good timing for the question :) A couple of things are WIP... An ability to specify command parameters using a json file and an ability to run docker-slim as a server where you can make http calls with json payloads.

ProfessorManhattan commented 2 years ago

Okay.. good to know.. another thing I'm looking to add is a way to test if the fat and slim containers output the same logs if a the same command is run on both containers.

Any ideas on how I should handle this in a way that could possibly benefit the community?

Also, one feature request for this new JSON feature - if we can store the config in any file (e.g. package.json under a certain key (e.g. "dockerSlimConfig"), that would be great -- there's already so much noise in most of my repositories because of config files.

Also, what's the use case of having docker-slim as an HTTP service? Very interesting. I hope more people start using docker-slim! It's so cool.

On Fri, Nov 5, 2021, 4:49 PM Kyle Quest @.***> wrote:

@ProfessorManhattan https://github.com/ProfessorManhattan good timing for the question :) A couple of things are WIP... An ability to specify command parameters using a json file and an ability to run docker-slim as a server where you can make http calls with json payloads.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/docker-slim/docker-slim/issues/239#issuecomment-962211320, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJRHXP3SKESDEIZAY4HU63UKRGOBANCNFSM5HNMMVFQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kcq commented 2 years ago

One interesting way to do it is to extend the run command in docker-slim to have some kind of diff mode (e.g., docker-slim run --mode diff --target image_one --target image_two.

What kind of verification are you looking for? Raw output log compare or something more intelligent that would extra and/or understand certain things from the logs?

ProfessorManhattan commented 2 years ago

Hey @kcq -- I like customizing each container in CI pipelines to be as small as possible with DockerSlim so I can quickly spot issues. I would like a way of confirming that the effects of running the fat container are the same as the effects of the slim container. The simple way I've been doing it is running a bash script to compare the stdout of the fat and slim container when a certain command is run. The diff command would be cool especially if it could pick up on changes that would be not be detectable otherwise. However, I would say the support for JSON build configs would be a bigger improvement --- when do you expect to finish the feature? I'd love to test it out when you have a PR.

ProfessorManhattan commented 2 years ago

ping @kcq -- just wondering if this feature is still planned and when it might be available either for testing on a PR or in the master branch

kcq commented 2 years ago

@ProfessorManhattan shooting for a New Year release with this enhancement included :)

ProfessorManhattan commented 2 years ago

@kcq -- stoked... how can I get my images included on the docksl.im website?

kcq commented 2 years ago

@ProfessorManhattan what do you mean?

ProfessorManhattan commented 2 years ago

Oh, I thought there was a catalog of pre-made slim images when I last checked it out

On Sat, Dec 25, 2021, 10:46 PM Kyle Quest @.***> wrote:

@ProfessorManhattan https://github.com/ProfessorManhattan what do you mean?

— Reply to this email directly, view it on GitHub https://github.com/docker-slim/docker-slim/issues/239#issuecomment-1001102562, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJRHXIJN537QQCFLMKINHTUS2F2RANCNFSM5HNMMVFQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

ProfessorManhattan commented 2 years ago

Hey @kcq -- when is the New Year release coming out with this enhancement? Was this feature already released because I don't see any documentation for it

In regards to my previous comment, when I signed into dockersl.im, I'm greeted with a list of popular repos. I was thinking that would be a place to show community-created slim images. I'd love to be able to see the configurations people are using but I'm not sure how to find the best examples.

kcq commented 2 years ago

There's a minification related regression (nginx image fail to minify due to changes in pid file handling). Need to fix that.

You'll be able to create your own collections in Slim SaaS and they'll show up that home screen. There'll be an ability to share your collections with the platform or other SaaS users (there's an early version of it already though it'll need more work). It might be interesting to have an auto-generated collection for the public images other users are scanning or minifying. Need to figure out what to do with malicious users to prevent them from spamming platform users with junk and preventing them from exposing others to malware images.

The initial version of collections is currently available to the SaaS design partners. We can explore if you be interested in joining the program.