I'm executing a command docker ps -a | grep <imagename>
from another container.
It shows
sh: grep: command not found
sh: docker: command not found
Can anyone support me on it?
I'm executing a command docker ps -a | grep <imagename>
from another container.
It shows
sh: grep: command not found
sh: docker: command not found
Can anyone support me on it?
When you create image1
, depending on its base image:
grep
installed (depending on your base image, or your $PATH
defined in that image )So start by checking those two factors.
If you are searching for an image name, you can try:
docker ps --filter ancestor=image_name
If you are searching for a container name, you can try:
docker ps --filter "name=container_name"
But the fellas are right, if you don't have docker installed on that container, you won't be able to execute the docker ps command.