Docker-alpine: Issue with supported formatting commands for "ps"

Created on 11 May 2016  路  2Comments  路  Source: gliderlabs/docker-alpine

I've run into a problem on one of my containers built using alpine 3.3.

When I run the following command:

ps

Sample output:

PID   USER     TIME   COMMAND
    1 root       0:00 /bin/bash /entrypoint.sh
  20 nginx      0:00 php-fpm: pool www

and then proceed to run the following command:

ps -A -o pid,command | grep [f]pm 

I get the following error:

ps: bad -o argument 'command', supported arguments: user,group,comm,args,pid,ppid,pgid,etime,nice,rgroup,ruser,time,tty,vsz,stat,rss

I understand what the error means and how to solve my problem, but I want to understand why it doesn't work. I've carried out the same steps on a VM based on CentOS 7 and it does work.

Is it simply down to different implementations of "ps" or is there something more to it?

Thanks,

question

Most helpful comment

The default ps in the image is a BusyBox command. You need to install procps to get the ps you are expecting:

apk --no-cache add procps

All 2 comments

The default ps in the image is a BusyBox command. You need to install procps to get the ps you are expecting:

apk --no-cache add procps

make

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ncopa picture ncopa  路  4Comments

rmNyro picture rmNyro  路  3Comments

robinmonjo picture robinmonjo  路  4Comments

konradjurk picture konradjurk  路  5Comments

dniku picture dniku  路  4Comments