July 2018
Intermediate to advanced
504 pages
11h 34m
English
From the output, we can see that the container status is UP. Now we can execute some commands inside the container using the docker exec command with different options:
$ docker exec -i 00f343906df3 ls -l /total 12drwxr-xr-x. 2 root root 4096 Feb 15 04:18 bindrwxr-xr-x. 2 root root 6 Nov 19 15:32 bootdrwxr-xr-x. 5 root root 360 Mar 6 21:17 devdrwxr-xr-x. 42 root root 4096 Mar 6 21:17 etcdrwxr-xr-x. 2 root root 6 Nov 19 15:32 home...Output truncated for brevity...
Option -i (--interactive) allows you to run a Docker without dropping inside the container. But we can easily override this behavior and enter this container by using -i and -t (--tty) options (or just -it):
$ docker exec -it 00f343906df3 /bin/bash ...