In ubuntu based 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
Now If run ps -p 1 -o user=
, it will get me PID 1 process USER postgres
$ ps -p 1 -o user=
postgres
This is what I can do in ubuntu
based image/os
Now
I am really seeking for a way to do the same for alpine
based image. Where I can run ps
command to get PID 1 process USER.
I didn't find any docs/hints around.
There is very cut version of
ps
in alpine image by default. It is busybox one:It can only show output with defined columns.
If you want use uncut
ps
, you need to install it first to alpine image:Now, you can use it you want: