如何使用ps在BusyBox中对进程进行grep

时间:2018-08-06 15:05:29

标签: docker jenkins jenkins-pipeline busybox

当我尝试运行ps -ef|grep process命令时,jenkins管道中出现错误消息:

ps: unrecognized option: p
BusyBox v1.27.2 (2017-12-12 10:41:50 GMT) multi-call binary.
Usage: ps [-o COL1,COL2=HEADER]
Show list of processes
-o COL1,COL2=HEADER Select columns for displayI have Jenkins version 2.135 and

我有BusyBox v1.27.2

有人可以告诉我如何在不安装ps -ef|grep process的情况下避免alpine image的错误吗

1 个答案:

答案 0 :(得分:0)

您可以使用

docker exec -it container_name ps -ef | grep process 

或者您可以通过运行ps -ef | grep process

对容器进行docker exec -it container_name /bin/bash