【发布时间】:2018-07-17 06:22:04
【问题描述】:
在基于 ubuntu 的 docker/os 中
$ ps
PID USER TIME COMMAND
1 postgres 0:00 postgres
47 postgres 0:00 postgres: checkpointer process
48 postgres 0:00 postgres: writer process
49 postgres 0:00 postgres: wal writer process
50 postgres 0:00 postgres: autovacuum launcher process
51 postgres 0:00 postgres: stats collector process
52 postgres 0:00 postgres: bgworker: logical replication launcher
现在如果运行ps -p 1 -o user=,它会得到我PID 1 进程用户postgres
$ ps -p 1 -o user=
postgres
这就是我可以在基于ubuntu 的图像/操作系统中做的事情
现在
我真的在寻找一种方法来为基于alpine 的图像做同样的事情。我可以在哪里运行 ps 命令来获取 PID 1 进程 USER。
我没有找到任何文档/提示。
【问题讨论】: