November 2017
Intermediate to advanced
298 pages
7h 10m
English
When logs aren't really enough to figure things out, the command to use is docker exec in order to execute a command on the running container that can include access to a full-blown shell:
$ docker run -d \ -p 8080:80 \ nginx06ebb46f64817329d360bb897bda824f932b9bcf380ed871709c2033af069118$ docker exec 06ebb46f ls -la /etc/nginx/conf.d/total 12drwxr-xr-x 2 root root 4096 Jul 26 07:33 .drwxr-xr-x 3 root root 4096 Jul 26 07:33 ..-rw-r--r-- 1 root root 1093 Jul 11 13:06 default.conf
In this case, we used docker exec to run the ls command in the container, but as-is that is not really a powerful debugging tool. What if we try to get that full shell within the container and examine it that way?
$ docker exec -it \ ...
Read now
Unlock full access