ps命令在docker容器不存在
程序员文章站
2022-05-11 15:39:10
...
问题描述:
$ docker exec -it c0 bash
[email protected]:/# which nginx
/usr/sbin/nginx
[email protected]:/# ps -ef
bash: ps: command not found
解决方案:
问题是该nginx镜像没有打包ps命令
使用如下命令安装
apt-get update && apt-get install procps
[email protected]:/# apt-get update && apt-get install procps
安装...
[email protected]:/# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 06:30 ? 00:00:00 nginx: master process nginx -g daemon off;
nginx 7 1 0 06:30 ? 00:00:00 nginx: worker process
root 349 0 0 08:25 pts/0 00:00:00 bash
root 594 349 0 08:26 pts/0 00:00:00 ps -ef
上一篇: iOS数据存储(一)