Giter Site home page Giter Site logo

Silent mode? about slim HOT 9 CLOSED

slimtoolkit avatar slimtoolkit commented on May 19, 2024 1
Silent mode?

from slim.

Comments (9)

kcq avatar kcq commented on May 19, 2024 1

Yes :-) You can use the "--continue-after" build option. The "probe" value is good when you use the HTTP probe feature to interact with your image. That way DockerSlim will wait for the probe to finish and then it'll continue minifying the image. You can use a "timeout" instead. It defaults to 60 seconds, but you can specify a custom timeout by passing the number of seconds you want to wait. You can also signals if you pick the "signal" value. Send the USR1 signal to the DockerSlim process.

Soon there'll be an HTTP server mode too, so you'll be able to control DockerSlim using HTTP API calls.

from slim.

vraravam avatar vraravam commented on May 19, 2024

How can i specify the timeout value? An example of this would be greatly appreciated!

I'm currently invoking like this: docker-slim build --continue-after=timeout my-api --http-probe-off - but, im unable to figure out how to specify a timeout value less than 60 secs. Ideally, i would prefer no timeout

from slim.

kcq avatar kcq commented on May 19, 2024

The command should look something like this docker-slim build --continue-after=30 --http-probe-off my-api. I assume my-api is a containerized CLI app. It makes sense to have a mode to continue once the app exits without waiting any extra time.

from slim.

vraravam avatar vraravam commented on May 19, 2024

Thanks @kcq - I was trying with a value of 0 (intending for fully non-interactive mode, but that reverts back to waiting for user input. Instead, 1 works perfectly fine!

my-app is an image for a java springboot application whose ENTRYPOINT is java -jar ... so, it'll not exit per se

from slim.

kcq avatar kcq commented on May 19, 2024

@vraravam you don't want to turn off http probing then because one way or another the app needs to have a chance to fully initialize, which may take a bit longer than usual because the app is traced. With the default http probe (which you get if you don't set any extra params) your app will get pinged with GET / and the probe will keep trying until it gets a response or it runs out of the number of retries it uses. If your springboot app has a different root path you'll want to specify a custom http probe command like this --http-probe-cmd /your/app/api/root/path.

from slim.

vraravam avatar vraravam commented on May 19, 2024

Thanks for the explanations @kcq - but, while building the image, i fail to understand why i need the app to fully initialize. Could you please elaborate? I can understand if running, but, while building?

from slim.

kcq avatar kcq commented on May 19, 2024

@vraravam the build command in docker-slim performs static and dynamic analysis on the target container images and it ends up creating an ephemeral container to do the dynamic analysis and that's where the probes are used.

from slim.

vraravam avatar vraravam commented on May 19, 2024

sorry to belabor the point, but what's the use of dynamic analysis? Is it for cases where the app writes files to some disk location or other similar functionality?

from slim.

kcq avatar kcq commented on May 19, 2024

Dynamic analysis is necessary to understand the containerized application and what it needs. The information collected during dynamic analysis is augmented with the information collected with static analysis and all that is used to generate the minified image. Without that information you'll have to use a lot of the --include-*** parameters to explicitly declare what you want to keep when it comes to the system dependencies.

from slim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.