jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-70288] docker.inside(..) does not work with busybox top.

Open
#702 0 comments 0 reactions 0 assignees View on GitHub
component:docker-workflow-plugin imported-jira-issue priority:minor resolution:unresolved
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.

According to https://github.com/jenkinsci/docker-workflow-plugin/blob/master/src/main/java/org/jenkinsci/plugins/docker/workflow/client/DockerClient.java#L153 

 


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.


  • status: Open
  • priority: Minor
  • component(s): docker-workflow-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-07

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.

According to https://github.com/jenkinsci/docker-workflow-plugin/blob/master/src/main/java/org/jenkinsci/plugins/docker/workflow/client/DockerClient.java#L153 

 


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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.