jenkinsci / jenkinsci/docker-workflow-plugin
[JENKINS-70288] docker.inside(..) does not work with busybox top.
- Dominant language
- Java
- Stars
- 527
- Forks
- 422
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
We are building docker images based on the Google distroless java images where the only non-JDK binaries are busybox symlinks.
LaunchResult result = launch(launchEnv, false, "top", containerId, "-eo", "pid,comm");
the way to get a list of processes currently running is to parse the output of "top -eo pid,comm".
The busybox `top` does not support this so it halts immediately and the container goes away with an IOException.
```
~ $ top -eo pid,comm
top: unrecognized option: e
BusyBox v1.34.1 (2022-04-13 00:26:55 UTC) multi-call binary.Usage: top [-bmH] [-n COUNT] [-d SECONDS]Show a view of process activity in real time.
Read the status of all processes from /proc each SECONDS
and show a screenful of them.
Keys:
N/M/P/T: show CPU usage, sort by pid/mem/cpu/time
S: show memory
R: reverse sort
H: toggle threads, 1: toggle SMP
Q,^C: exit
Options:
-b Batch mode
-n N Exit after N iterations
-d SEC Delay between updates
-m Same as 's' key
-H Show threads
```
---
Originally reported by ravn, imported from: docker.inside(..) does not work with busybox top.
Raw content of original issue
We are building docker images based on the Google distroless java images where the only non-JDK binaries are busybox symlinks.
LaunchResult result = launch(launchEnv, false, "top", containerId, "-eo", "pid,comm");
the way to get a list of processes currently running is to parse the output of "top -eo pid,comm".
The busybox `top` does not support this so it halts immediately and the container goes away with an IOException.
~ $ top -eo pid,comm
top: unrecognized option: e
BusyBox v1.34.1 (2022-04-13 00:26:55 UTC) multi-call binary.Usage: top [-bmH] [-n COUNT] [-d SECONDS]Show a view of process activity in real time.
Read the status of all processes from /proc each SECONDS
and show a screenful of them.
Keys:
N/M/P/T: show CPU usage, sort by pid/mem/cpu/time
S: show memory
R: reverse sort
H: toggle threads, 1: toggle SMP
Q,^C: exit
Options:
-b Batch mode
-n N Exit after N iterations
-d SEC Delay between updates
-m Same as 's' key
-H Show threads
Contributor guide
Assessment
This issue has not been assessed yet.