Search code examples
debiandocker

ps command doesn't work in docker container


I want to do a ps command in a docker container derived from Debian official Docker hub repository:

$ docker run -ti debian:wheezy /bin/bash
root@51afd6b09af8:/# ps
bash: ps: command not found

Solution

  • ps is not installed in the base wheezy image. Try this from within the container:

    apt-get update && apt-get install procps
    

    or add the following line to the Dockerfile:

    RUN apt-get update && apt-get install -y procps && rm -rf /var/lib/apt/lists/*