K
K
krll-k2016-12-06 09:25:40
Asterisk
krll-k, 2016-12-06 09:25:40

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

3 answer(s)
S
silverjoe, 2016-12-06
@krll-k

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?

K
Karmashkin, 2016-12-06
@Karmashkin

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 ;)

K
krll-k, 2016-12-07
@krll-k

use --volumes-from

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question