June 2016
Intermediate to advanced
600 pages
8h 6m
English
To do the same kind of diagnostics on a running container, you can either:
• attach to the container using the docker attach command.
• use the docker exec command to execute commands in the container and return the result to the command prompt using docker exec <container-id> command.
For example, you can call the exec command on the elasticsearch container using the first four characters of the container id, “bbd8,” to view the contents of a file using the Linux cat command.
docker exec bbd8 cat docker-entrypoint.sh
This will execute the command in the container and return the output, in this case the contents of the docker-entrypoint.sh file as shown in Figure 4.9.
FIGURE 4.9: ...
Read now
Unlock full access