But there is no output for the above command. Let’s see what’s going on under the hood (sherlock mode on \ud83d\ude0e)<\/p>\r\n
\r\n$ docker ps<\/pre>\r\n<\/blockquote>\r\n
<\/p>\r\n
Interesting! it’s not running anymore. The docker ps command also has -a option to show the stopped containers.<\/p>\r\n
<\/p>\r\n
You can see that our alpine container started, the shell executed and then exited.<\/p>\r\n
Note:<\/strong> The docker ps<\/strong> is probably the first command you run once you know the host (ps aux | grep dockerd<\/strong>) is using docker.<\/p>\r\nThis is bad news for us, why?<\/p>\r\n
One, we didn’t get time to analyze the container for security issues, the container was short-lived. Two, there are many alpine containers in the above output. Which one is ours? and how do we ensure, we are targeting the right container (without affecting other containers)?<\/p>\r\n
In short, we have two problems to solve before we can analyze this image.<\/p>\r\n
\r\n- Identify the right container.<\/li>\r\n
- Stop a container from exiting.<\/li>\r\n<\/ol>\r\n