File tree 4 files changed +66
-0
lines changed
4 files changed +66
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM debian:jessie
2
+ MAINTAINER Razvan Crainea <
[email protected] >
3
+
4
+ USER root
5
+ ENV DEBIAN_FRONTEND noninteractive
6
+ ARG VERSION=2.2
7
+
8
+ WORKDIR /usr/local/src
9
+
10
+ RUN apt-get update -qq && apt-get install -y build-essential \
11
+ git bison flex m4 pkg-config libncurses5-dev rsyslog
12
+
13
+ RUN git clone https://github.com/OpenSIPS/opensips.git -b $VERSION opensips_$VERSION
14
+ RUN cd opensips_$VERSION && make all && make install
15
+
16
+ RUN echo -e "local0.* -/var/log/opensips.log\n & stop" > /etc/rsyslog.d/opensips.conf
17
+ RUN touch /var/log/opensips.log
18
+
19
+ EXPOSE 5060/udp
20
+
21
+ COPY run.sh /run.sh
22
+
23
+ ENTRYPOINT ["/run.sh" ]
Original file line number Diff line number Diff line change
1
+ NAME ?= opensips
2
+ OPENSIPS_VERSION ?= 2.2
3
+
4
+ all : build start
5
+
6
+ .PHONY : build start
7
+ build :
8
+ docker build --build-arg=VERSION=$(OPENSIPS_VERSION ) --tag=" opensips/opensips:$( OPENSIPS_VERSION) " .
9
+
10
+ start :
11
+ docker run -d --name $(NAME ) opensips/opensips:$(OPENSIPS_VERSION )
Original file line number Diff line number Diff line change
1
+ # OpenSIPS Docker Image
2
+ http://www.opensips.org/
3
+
4
+ Docker recipe for building and starting an OpenSIPS image
5
+
6
+ ## Building the image
7
+ You can build the docker image by running:
8
+ ```
9
+ make build
10
+ ```
11
+
12
+ This command will build a docker image with OpenSIPS master version taken from
13
+ the git repository. To build a different git version, you can run:
14
+ ```
15
+ OPENSIPS_VERSION=2.2 make build
16
+ ```
17
+
18
+ To start the image, simply run:
19
+ ```
20
+ make start
21
+ ```
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ HOST_IP=$( ip route get 8.8.8.8 | head -n +1 | tr -s " " | cut -d " " -f 7)
4
+
5
+ sed -i " s/listen=.*/listen=udp:${HOST_IP} :5060/g" /usr/local/etc/opensips/opensips.cfg
6
+
7
+ service rsyslog start
8
+
9
+ /usr/local/sbin/opensipsctl start
10
+
11
+ tail -f /var/log/opensips.log
You can’t perform that action at this time.
0 commit comments