I have a JBoss, when it starts and deploys, it writes log file into /var/log/jboss-as/console.log line by line.
I want to print the log file line by line when I launch the container, so I can debug easily.
I tried something like:
RUN tail -F /var/log/jboss-as/console.log
in my Dockerfile. But it failed to build the image. It hanged and nothing happened after.
How can I print the log file without hanging?
Thanks.
You shouldn't include tail -f inside docker file.
You can run:
docker exec -it jboss tail -f /var/log/jboss-as/console.log
after you've started your container.
Start your container with a command like:
docker run -it imagename
It should print any STDOUT to your console. Then you can use Ctrl-P Ctrl-Q to exit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With