Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1245 from sergey-safarov/alpine
pkg/kamailio/alpine: Packaged rabbitmq, sctp, radius modules and created docker scripts
- Loading branch information
Showing
8 changed files
with
290 additions
and
171 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
131 changes: 0 additions & 131 deletions
131
pkg/kamailio/alpine/0003-src_modules_tls_tls_init_c.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM scratch | ||
|
||
ADD kamailio_img.tar.gz / | ||
COPY entrypoint.sh / | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
About | ||
----- | ||
|
||
Container designed to run on host, bridge and swarm network. | ||
Size of container decreased to 50MB (23MB compressed) | ||
Significantly increased security - removed all libs except libc, busybox, tcpdump, dumpcap, kamailio and dependent libs. | ||
Docker container is created useing Alpine linux packaging | ||
|
||
Used environment variables | ||
-------------------------- | ||
|
||
1. ```SHM_MEMORY``` - amount of shared memory to allocate for the running Kamailio server (in Mb), default value 64Mb; | ||
2. ```PKG_MEMORY``` - amount of per-process (package) memory to allocate for Kamailio (in Mb), default value 8Mb | ||
|
||
Usage container | ||
--------------- | ||
|
||
```sh | ||
docker run --net=host --name kamailio \ | ||
-v /etc/kamailio/:/etc/kamailio \ | ||
kamailio/kamailio | ||
``` | ||
|
||
systemd unit file | ||
----------------- | ||
|
||
You can use this systemd unit files on your docker host. | ||
Unit file can be placed to ```/etc/systemd/system/kamailio-docker.service``` and enabled by commands | ||
```sh | ||
systemd start kamailio-docker.service | ||
systemd enable kamailio-docker.service | ||
``` | ||
|
||
host network | ||
============ | ||
|
||
```sh | ||
$ cat /etc/systemd/system/kamailio-docker.service | ||
[Unit] | ||
Description=kamailio Container | ||
After=docker.service network-online.target | ||
Requires=docker.service | ||
|
||
|
||
[Service] | ||
Restart=always | ||
TimeoutStartSec=0 | ||
#One ExecStart/ExecStop line to prevent hitting bugs in certain systemd versions | ||
ExecStart=/bin/sh -c 'docker rm -f kamailio; \ | ||
docker run -t --net=host --name kamailio \ | ||
-v /etc/kamailio/:/etc/kamailio \ | ||
kamailio/kamailio' | ||
ExecStop=-/bin/sh -c '/usr/bin/docker stop kamailio; \ | ||
/usr/bin/docker rm -f kamailio;' | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
``` | ||
|
||
default bridge network | ||
====================== | ||
```sh | ||
[Unit] | ||
Description=kamailio Container | ||
After=docker.service network-online.target | ||
Requires=docker.service | ||
|
||
|
||
[Service] | ||
Restart=always | ||
TimeoutStartSec=0 | ||
#One ExecStart/ExecStop line to prevent hitting bugs in certain systemd versions | ||
ExecStart=/bin/sh -c 'docker rm -f kamailio; \ | ||
docker run -t --network bridge --name kamailio \ | ||
-p 5060:5060/udp -p 5060:5060 \ | ||
-v /etc/kamailio/:/etc/kamailio \ | ||
kamailio/kamailio' | ||
|
||
ExecStop=-/bin/sh -c '/usr/bin/docker stop kamailio; \ | ||
/usr/bin/docker rm -f kamailio;' | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
``` | ||
|
||
.bashrc file | ||
------------ | ||
To simplify kamailio managment you can add alias for ```kamctl``` to ```.bashrc``` file as example bellow. | ||
```sh | ||
alias kamctl='docker exec -i -t kamailio /usr/sbin/kamctl' | ||
``` |
Oops, something went wrong.