Answer the question
In order to leave comments, you need to log in
How to properly use docker volume? How to display a folder with logs outside a running container?
Imagine the situation: There is an Asterisk server. It is running on the host but isolated in a Docker container. Launched, has been working for a year, do not touch. Everything is good. But time passes, it became necessary to configure, say, Fail2ban on this same Asterisk. Setting up Fail2ban inside the container running Asterisk seems wrong. What to do?
The container is running. Slow down the container specifically in order to forward the volume with the logs for Fail2ban? To stop means to withdraw losing potential customers. The question arises, but it is impossible / possible to work with volume when the container is running. That is, how to bring the folder with logs outside the container into a separate volume that will be available on the host and in other containers?
Answer the question
In order to leave comments, you need to log in
1. Take a folder on the host /var/log/asterisk-docker
2. Set up its auto-mounting in a container with an asterisk in full access mode
3. Set up asterisk logs in this folder
4. ... is it clear then?
if it is absolutely undesirable to extinguish the container, as an option, you can configure the sending of logs from the container with a cron or equivalent.
just save the container before trying ;)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question