Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gennadiy Dubina
committed
Apr 14, 2016
1 parent
fcd5084
commit 08a857e
Showing
7 changed files
with
98 additions
and
14 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,12 +1 @@ | ||
*.class | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
release |
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,23 @@ | ||
FROM java:7-jdk | ||
MAINTAINER gdubina@dataart.com | ||
|
||
RUN apt-get update | ||
RUN apt-get install net-tools | ||
|
||
ADD https://mobicents.ci.cloudbees.com/view/MediaServer/job/RestComm-MediaServer-4.x/lastSuccessfulBuild/artifact/bootstrap/target/restcomm-media-server.zip /tmp/restcomm-media-server.zip | ||
|
||
ADD https://mobicents.ci.cloudbees.com/view/MediaServer/job/RestComm-MediaServer-4.x/lastSuccessfulBuild/artifact/media-version.txt /tmp/media-version.txt | ||
|
||
ENV work_dir /opt/restcomm-media-server | ||
|
||
RUN unzip /tmp/restcomm-media-server.zip -d /opt && \ | ||
chmod +x $work_dir/bin/run.sh && \ | ||
rm /tmp/restcomm-media-server.zip && \ | ||
mv /tmp/media-version.txt $work_dir | ||
|
||
ADD scripts/configure.sh $work_dir | ||
ADD scripts/run.sh $work_dir | ||
|
||
WORKDIR $work_dir | ||
CMD ./run.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 |
---|---|---|
@@ -1,2 +1,20 @@ | ||
# mediaserver-docker | ||
Docker Image for RestComm Media Server at https://github.com/RestComm/mediaserver | ||
# Restcomm MediaServer docker container | ||
|
||
Restcomm mediaserver repo - https://github.com/RestComm/mediaserver | ||
|
||
###Supported env variables | ||
|
||
1. To modify properties in `server-beans.xml` you can use the following template `PROPERTY_xmlpropname`. **Example:** PROPERTY_lowestPort, PROPERTY_highestPort | ||
|
||
2. if you run docker container with `--net=host` you should setup `USE_HOST_NETWORK=true`. in this case mediserver will be bound to `eth0` ip address | ||
|
||
### Run command example | ||
|
||
```shell | ||
docker run --net host -d \ | ||
--name restcomm-mediaserver \ | ||
-e PROPERTY_lowestPort=64000 \ | ||
-e PROPERTY_highestPort=65500 \ | ||
-e USE_HOST_NETWORK=true \ | ||
-it restcomm-mediaserver | ||
``` |
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,9 @@ | ||
#!/bin/bash | ||
|
||
docker build -t restcomm-mediaserver . | ||
|
||
VERSION=`curl -s https://mobicents.ci.cloudbees.com/view/MediaServer/job/RestComm-MediaServer-4.x/lastSuccessfulBuild/artifact/media-version.txt` | ||
echo "MediaServer build version: $VERSION" | ||
|
||
docker tag -f restcomm-mediaserver:latest restcomm-mediaserver:$VERSION | ||
|
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,10 @@ | ||
#!/bin/bash | ||
|
||
docker rm -f restcomm-mediaserver | ||
|
||
docker run --net host -d \ | ||
--name restcomm-mediaserver \ | ||
-e PROPERTY_lowestPort=64000 \ | ||
-e PROPERTY_highestPort=65500 \ | ||
-e USE_HOST_NETWORK=true \ | ||
-it restcomm-mediaserver |
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,30 @@ | ||
#!/bin/bash | ||
|
||
BASE_DIR=$work_dir | ||
CONFIG_FILE=$BASE_DIR/deploy/server-beans.xml | ||
|
||
if [ -n "$USE_HOST_NETWORK" ]; then | ||
LOCAL_IP=`ifconfig eth0 | awk '/inet addr/{print substr($2,6)}'` | ||
PROPERTY_bindAddress=$LOCAL_IP | ||
PROPERTY_localBindAddress=$LOCAL_IP | ||
fi | ||
|
||
set_xml_property () { | ||
local property=$1 | ||
local new_value=$2 | ||
local xml_file=$3 | ||
sed -i "s|<property name=\"$property\">.*</property>|<property name=\"$property\">$new_value</property>|" $xml_file | ||
} | ||
|
||
echo "********************************" | ||
echo "*** Configure media server ***" | ||
echo "********************************" | ||
|
||
for i in $( set -o posix ; set | grep ^PROPERTY_ | sort -rn ); do | ||
reg=$(echo ${i} | cut -d = -f1 | cut -c 10-) | ||
val=$(echo ${i} | cut -d = -f2) | ||
|
||
echo "Update property: $reg -> $val" | ||
|
||
set_xml_property $reg $val $CONFIG_FILE | ||
done |
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,5 @@ | ||
#!/bin/bash | ||
|
||
. configure.sh | ||
|
||
./bin/run.sh |