Comments (9)
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.
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.
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.
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.
@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.
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.
@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.
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.
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)
- Unable to run demo application HOT 1
- Curious LDFLAGS in build script HOT 1
- --env-file flag to specify multiple environment variable in a file HOT 17
- Report exit code for the target containerized application if/when it crashes and when it exits HOT 5
- Error after image compression HOT 1
- Save docker with changes HOT 1
- `make help` command does not show make target name
- make build_m1 command not working HOT 2
- Non usable python-gunicorn docker slimed image HOT 1
- slim ci-cd-integration HOT 4
- Unit tests failing in CI
- Format validation for the --env flag values HOT 3
- `slim build` doesn't generate optimized Dockerfile HOT 3
- CLI Enhancement: Ability to specify all command parameters in a json file ("command-params-file" flag) HOT 5
- Feature: New top level helper command to create a multi-architecture image from architecture specific images HOT 2
- docker-slim build exited code=16777218
- I add --exclude-pattern=/var/lock can fix it! HOT 2
- Azure Functions docker image - Docker slim fails HOT 1
- slim image size is different each time from same fat image and use same cmd line
- Ubuntu 23.10 slim build error docker socket not found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slim.