I try to deploy an app in docker container using mcr.microsoft.com/dotnet/aspnet:5.0
image that need to have top command
when I try to run top command the following result shown:
bash: top: command not found
how can I install top command?
I try to run following command inside docker container to search top command
$ apt-file search --regexp '/top$'
The result:
broctl: /usr/share/broctl/scripts/helpers/top
crossfire-maps: /usr/share/games/crossfire/maps/santo_dominion/magara/well/top
crossfire-maps-small: /usr/share/games/crossfire/maps/santo_dominion/magara/well/top
liece: /usr/share/emacs/site-lisp/liece/styles/top
lxpanel: /etc/xdg/lxpanel/two_panels/panels/top
open-infrastructure-container-tools: /usr/lib/open-infrastructure/container/top
procps: /usr/bin/top
quilt: /usr/share/quilt/top
so I try to install procps using following command inside the docker container
$ apt install procps
apt install procps
just restart your SSH connection to the Virtual Machine.
Commented
Jun 27, 2022 at 15:00
Its probably intentional - the docker philosophy is pretty much one application/process a container with whatever it needs to run.
You're unlikely to need a full set of userland tools in a container. If you do need to inspect the container itself, you can use docker top
from the system running the docker instance instead.