Ever need to debug your process in containers? Use strace, lsof, pstree, or anything you name it. But after login, you get a surprise: The tools are not installed!
So what will you do? Typically we have 3 different methods. Check it out, and discuss with me.
(Hint: You don’t have to install the tools at all)
Check More Discussion In LinkedIn
Start a nginx container for explanation. We will run tools against the nginx process afterwards.
# pull docker image docker pull nginx:alpine # start container docker run -t -d --privileged \ -h nginxtest --name nginx-test \ -p 8080:80 nginx:alpine
Check nginx process:
# verify nginx httpd service curl http://localhost:8080 # check process pid docker exec nginx-test ps -ef | grep nginx