Run Asterisk on Alpine Linux with Docker.
A fast and simple way to test a new configuration for your pbx or run with a simple configuration (e.g. at home).
docker build -t asterisk-alpine-docker .
If you already have asterisk configuration files, then you can skip this step (go on with 3.).
docker run --name asterisk-alpine-docker-sample --net=host -d -t christianbecker/asterisk-alpine-docker
To get started just copy the sample configuration from docker container to your own directory. The container can be deleted after this step.
docker cp asterisk-alpine-docker-sample:/etc/asterisk/. etc-asterisk/
docker stop asterisk-alpine-docker-sample
docker rm asterisk-alpine-docker-sample
Make your changes to files in "etc-asterisk" directory and use it as docker volume in a new container.
Run docker container with your own configuration and let docker restart it automatically if necessary.
docker run --name asterisk-alpine-docker --net=host -v $(pwd)/etc-asterisk/:/etc/asterisk/ -d -t --restart=always christianbecker/asterisk-alpine-docker
To simplify the management you can add the following aliases to .bash_aliases
or .bashrc
:
alias astlog='docker logs -f --tail 20 asterisk-alpine-docker'
alias asterisk='docker exec -it asterisk-alpine-docker asterisk'
Then simply use astlog
or asterisk -r
in bash console on docker host system.
- Christian Becker - christian-becker
This project is licensed under the MIT License - see the LICENSE file for details.