From 589a75638426dc799e99f6f3b6db7b21cc8d7757 Mon Sep 17 00:00:00 2001 From: Josh Stark Date: Thu, 24 Jan 2019 20:55:54 +0000 Subject: [PATCH] Create container-execution.md --- general/container-execution.md | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 general/container-execution.md diff --git a/general/container-execution.md b/general/container-execution.md new file mode 100644 index 0000000000..39654b350b --- /dev/null +++ b/general/container-execution.md @@ -0,0 +1,46 @@ +# Container Execution + +You may find at some point you need to view the internal data of a container. + +## Shell Access + +Particularly useful when debugging the application - to shell in to one of our containers, run the following: + +```bash +docker exec -it /bin/bash +``` + +## Tailing the logs + +The vast majority of our images are configured to output the application logs to the console, which in Docker's terms means you can access them using the `docker logs` command: + +```bash +docker logs -f --tail= +``` + +The `--tail` argument is optional, but useful if the application has been running for a long time - the `logs` command by default will output _all_ logs. + +To make life simpler for yourself here's a handy bash alias to do some of the leg work for you: + +```bash +# ~/.bash_aliases +alias dtail='docker logs -tf --tail="50" "$@"' +``` + +Execute it with `dtail `. + +## Checking the build version + +If you are experiencing issues with one of our containers, it helps us to know which version of the image your container is running from. The primary reason we ask for this is because you may be reporting an issue we are aware of and have subsequently fixed. However, if you are running on the latest version of our image, it could indeed be a newly found bug, which we'd want to know more about. + +To obtain the build version for the image: + +```bash +docker inspect -f '{{ index .Config.Labels "build_version" }}' +``` + +Or the container: + +```bash +docker inspect -f '{{ index .Config.Labels "build_version" }}' linuxserver/ +```