Change in docker-playground[master]: Add first osmo-cn-latest image

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Mar 29 11:14:15 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13438 )

Change subject: Add first osmo-cn-latest image
......................................................................

Add first osmo-cn-latest image

Core network in a container. Starts all the services, configuration
needs to be tweaked.

Change-Id: Icfddc75447fbd94f9d5c19408ccc7f3a914e083f
---
A osmo-cn-latest/.release
A osmo-cn-latest/Dockerfile
A osmo-cn-latest/Makefile
A osmo-cn-latest/Release.key
A osmo-cn-latest/osmo-ggsn.cfg
A osmo-cn-latest/osmo-hlr.cfg
A osmo-cn-latest/osmo-mgw.cfg
A osmo-cn-latest/osmo-msc.cfg
A osmo-cn-latest/osmo-sgsn.cfg
A osmo-cn-latest/osmo-stp.cfg
A osmo-cn-latest/run.sh
A osmo-cn-latest/runit/ggsn-run
A osmo-cn-latest/runit/hlr-run
A osmo-cn-latest/runit/mgw-run
A osmo-cn-latest/runit/msc-run
A osmo-cn-latest/runit/sgsn-run
A osmo-cn-latest/runit/stp-run
17 files changed, 343 insertions(+), 0 deletions(-)

Approvals:
  Daniel Willmann: Verified
  Harald Welte: Looks good to me, approved



diff --git a/osmo-cn-latest/.release b/osmo-cn-latest/.release
new file mode 100644
index 0000000..334aa04
--- /dev/null
+++ b/osmo-cn-latest/.release
@@ -0,0 +1,2 @@
+release=0.0.0
+tag=osmo-cn-latest-0.0.0
diff --git a/osmo-cn-latest/Dockerfile b/osmo-cn-latest/Dockerfile
new file mode 100644
index 0000000..3b49c29
--- /dev/null
+++ b/osmo-cn-latest/Dockerfile
@@ -0,0 +1,45 @@
+FROM debian:stretch
+
+MAINTAINER Daniel Willmann <dwillmann at sysmocom.de>
+
+ARG OSMOCOM_REPO="http://download.opensuse.org/repositories/network:/osmocom:/latest/Debian_9.0/"
+
+COPY	Release.key /tmp/Release.key
+
+RUN	apt-get update && \
+	apt-get install -y --no-install-recommends \
+		gnupg
+
+RUN	apt-key add /tmp/Release.key && \
+	rm /tmp/Release.key && \
+	echo "deb " $OSMOCOM_REPO " ./" > /etc/apt/sources.list.d/osmocom-latest.list
+
+ADD	$OSMOCOM_REPO/Release /tmp/Release
+RUN	apt-get update && \
+	apt-get install -y --no-install-recommends \
+		osmo-msc osmo-hlr osmo-sgsn osmo-ggsn osmo-mgw osmo-stp \
+		runit telnet iptables && \
+	apt-get clean
+
+WORKDIR	/tmp
+
+VOLUME	/data
+COPY	osmo-stp.cfg /data/osmo-stp.cfg
+COPY	osmo-msc.cfg /data/osmo-msc.cfg
+COPY	osmo-hlr.cfg /data/osmo-hlr.cfg
+COPY	osmo-mgw.cfg /data/osmo-mgw.cfg
+COPY	osmo-sgsn.cfg /data/osmo-sgsn.cfg
+COPY	osmo-ggsn.cfg /data/osmo-ggsn.cfg
+
+COPY	runit/stp-run /etc/service/osmo-stp/run
+COPY	runit/msc-run /etc/service/osmo-msc/run
+COPY	runit/hlr-run /etc/service/osmo-hlr/run
+COPY	runit/mgw-run /etc/service/osmo-mgw/run
+COPY	runit/sgsn-run /etc/service/osmo-sgsn/run
+COPY	runit/ggsn-run /etc/service/osmo-ggsn/run
+
+WORKDIR	/data
+CMD	["/sbin/runit"]
+
+
+EXPOSE 23000/udp
diff --git a/osmo-cn-latest/Makefile b/osmo-cn-latest/Makefile
new file mode 100644
index 0000000..8d0e10b
--- /dev/null
+++ b/osmo-cn-latest/Makefile
@@ -0,0 +1 @@
+include ../make/Makefile
diff --git a/osmo-cn-latest/Release.key b/osmo-cn-latest/Release.key
new file mode 100644
index 0000000..e656238
--- /dev/null
+++ b/osmo-cn-latest/Release.key
@@ -0,0 +1,20 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.5 (GNU/Linux)
+
+mQENBFJBt/wBCADAht3d/ilNuyzaXYw/QwTRvmjyoDvfXw+H/3Fvk1zlDZoiKPPc
+a1wCVBINUZl7vYM2OXqbJwYa++JP2Q48xKSvC6thbRc/YLievkbcvTemf7IaREfl
+CTjoYpoqXHa9kHMw1aALDm8CNU88jZmnV7v9L6hKkbYDxie+jpoj7D6B9JlxgNJ4
+5dQyRNsFGVcIl4Vplt1HyGc5Q5nQI/VgS2rlF/IOXmhRQBc4LEDdU8R2IKnkU4ee
+S7TWanAigGAQhxGuCkS39/CWzc1DhLhjlNhBl/+RTPejkqJtAy00ZLps3+RqUN1Y
+CU/Fsr7aRlYVGqQ/BlptwV0XQ2VVYJX2oEBBABEBAAG0MG5ldHdvcmsgT0JTIFBy
+b2plY3QgPG5ldHdvcmtAYnVpbGQub3BlbnN1c2Uub3JnPokBPAQTAQIAJgUCWmMc
+aQIbAwUJDEAUbQYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEGLrGgkXKA3fjsoI
+ALSXmXzFCpTxg8a6tvXkqddY/qAmeBMNUf7hslI9wN3leNmCrnuHS8TbHWYJZgtw
+8M5fKL3aRQYaIiqqm1XOUF0OqwYNDj5V3y38mM68NYOkzgSP7foMwZp9Y0TlGhtI
+L8weA+2RUjB4hwwGMAYMqkRZyKW3NhPqdlGGoXac1ilwEyGXFHdOLbkhtyS+P2yb
+/EvaKIN5cMLzRZKeYgdp9WuAirV+yV/SDbgvabW098lrWhGLltlRRDQgMV883p8I
+ERMI1wlLFZGnHL3mfBWGeQ24M/DaBOdXQDtfBLCJ9nGztmDBUb8i6GFWU7nD2TGi
+8mYUsED1ZDwO/0jdvJ4gSluIRgQTEQIABgUCUkG3/AAKCRA7MBG3a51lIzhdAJ9v
+d6XPffMZRcCGgDEY5OaTn/MsCQCgrXbeZpFJgnirSrc8rRonvzYFiF4=
+=Gvly
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/osmo-cn-latest/osmo-ggsn.cfg b/osmo-cn-latest/osmo-ggsn.cfg
new file mode 100644
index 0000000..899f261
--- /dev/null
+++ b/osmo-cn-latest/osmo-ggsn.cfg
@@ -0,0 +1,51 @@
+!
+! OpenGGSN (0.94.1-adac) configuration saved from vty
+!!
+!
+log file /data/osmo-ggsn.log
+  logging filter all 1
+  logging color 0
+  logging print category 1
+  logging timestamp 1
+  logging level ip info
+  logging level tun info
+  logging level ggsn info
+  logging level sgsn notice
+  logging level icmp6 debug
+  logging level lglobal notice
+  logging level llapd notice
+  logging level linp notice
+  logging level lmux notice
+  logging level lmi notice
+  logging level lmib notice
+  logging level lsms notice
+  logging level lctrl notice
+  logging level lgtp info
+  logging level lstats notice
+  logging level lgsup notice
+  logging level loap notice
+  logging level lss7 notice
+  logging level lsccp notice
+  logging level lsua notice
+  logging level lm3ua notice
+  logging level lmgcp notice
+!
+stats interval 5
+!
+line vty
+ no login
+ bind 0.0.0.0
+!
+ggsn ggsn0
+ gtp state-dir /tmp
+ gtp bind-ip 127.0.0.2
+ apn internet
+  gtpu-mode tun
+  tun-device tun4
+  type-support v4
+  ip prefix dynamic 10.0.0.1/24
+  ip dns 0 9.9.9.9
+  ip ifconfig 10.0.0.0/24
+  no shutdown
+ default-apn internet
+ no shutdown ggsn
diff --git a/osmo-cn-latest/osmo-hlr.cfg b/osmo-cn-latest/osmo-hlr.cfg
new file mode 100644
index 0000000..77454ed
--- /dev/null
+++ b/osmo-cn-latest/osmo-hlr.cfg
@@ -0,0 +1,19 @@
+!
+! OsmoHLR example configuration
+!
+log file /data/osmo-hlr.log
+  logging filter all 1
+  logging color 0
+  logging print category 1
+  logging timestamp 1
+  logging print extended-timestamp 1
+  logging level all debug
+  logging level linp error
+!
+line vty
+ bind 0.0.0.0
+ctrl
+ bind 0.0.0.0
+hlr
+ gsup
+  bind ip 127.0.0.1
diff --git a/osmo-cn-latest/osmo-mgw.cfg b/osmo-cn-latest/osmo-mgw.cfg
new file mode 100644
index 0000000..c206914
--- /dev/null
+++ b/osmo-cn-latest/osmo-mgw.cfg
@@ -0,0 +1,53 @@
+!
+! OsmoMGW (1.2.0.17-52e3) configuration saved from vty
+!!
+!
+log file /data/osmo-mgw.log
+  logging filter all 1
+  logging color 1
+  logging print category 1
+  logging timestamp 0
+  logging level all everything
+  logging level rtp notice
+  logging level lglobal notice
+  logging level llapd notice
+  logging level linp notice
+  logging level lmux notice
+  logging level lmi notice
+  logging level lmib notice
+  logging level lsms notice
+  logging level lctrl notice
+  logging level lgtp notice
+  logging level lstats notice
+  logging level lgsup notice
+  logging level loap notice
+  logging level lss7 notice
+  logging level lsccp notice
+  logging level lsua notice
+  logging level lm3ua notice
+  logging level lmgcp debug
+!
+stats interval 5
+!
+line vty
+ no login
+ bind 0.0.0.0
+!
+mgcp
+  bind ip 127.0.0.1
+  bind port 2427
+  rtp port-range 4002 16000
+  rtp bind-ip 192.168.42.10
+  rtp ip-probing
+  rtp ip-dscp 184
+  no rtp keep-alive
+  no rtcp-omit
+  no rtp-patch
+  sdp audio-payload number 98
+  sdp audio-payload name GSM
+  sdp audio-payload send-ptime
+  sdp audio-payload send-name
+  loop 0
+  number endpoints 31
+  allow-transcoding
+  osmux off
diff --git a/osmo-cn-latest/osmo-msc.cfg b/osmo-cn-latest/osmo-msc.cfg
new file mode 100644
index 0000000..8924d1e
--- /dev/null
+++ b/osmo-cn-latest/osmo-msc.cfg
@@ -0,0 +1,30 @@
+!
+! OsmoMSC configuration saved from vty
+!
+log file /data/osmo-msc.log
+  logging filter all 1
+  logging color 1
+  logging print category 1
+  logging timestamp 0
+  logging level all everything
+!
+line vty
+ no login
+ bind 0.0.0.0
+!
+cs7 instance 0
+ asp asp-clnt-OsmoMSC-A-Iu 2905 2904 m3ua
+  remote-ip 192.168.42.10
+network
+ network country code 901
+ mobile network code 1
+ short name OsmoMSC
+ long name OsmoMSC
+ encryption a5 0
+ rrlp mode none
+ mm info 1
+msc
+ mgw remote-ip 127.0.0.1
+ assign-tmsi
+ auth-tuple-max-reuse-count 3
+ auth-tuple-reuse-on-error 1
diff --git a/osmo-cn-latest/osmo-sgsn.cfg b/osmo-cn-latest/osmo-sgsn.cfg
new file mode 100644
index 0000000..ef18604
--- /dev/null
+++ b/osmo-cn-latest/osmo-sgsn.cfg
@@ -0,0 +1,34 @@
+!
+! Osmocom SGSN (0.9.0.474-0ede2) configuration saved from vty
+!!
+!
+log file /data/osmo-sgsn.log
+  logging filter all 1
+  logging color 1
+  logging print category 1
+  logging timestamp 0
+  logging level all everything
+!
+line vty
+ no login
+ bind 0.0.0.0
+!
+sgsn
+ gtp local-ip 127.0.0.1
+ ggsn 0 remote-ip 127.0.0.2
+ ggsn 0 gtp-version 1
+ auth-policy remote
+ gsup remote-ip 127.0.0.1
+ gsup remote-port 4222
+ns
+ timer tns-block 3
+ timer tns-block-retries 3
+ timer tns-reset 3
+ timer tns-reset-retries 3
+ timer tns-test 30
+ timer tns-alive 3
+ timer tns-alive-retries 10
+ encapsulation udp local-ip 0.0.0.0
+ encapsulation udp local-port 23000
+ encapsulation framerelay-gre enabled 0
+bssgp
diff --git a/osmo-cn-latest/osmo-stp.cfg b/osmo-cn-latest/osmo-stp.cfg
new file mode 100644
index 0000000..96524de
--- /dev/null
+++ b/osmo-cn-latest/osmo-stp.cfg
@@ -0,0 +1,36 @@
+!
+! osmo-stp (0.0.6.3.179-b248) configuration saved from vty
+!!
+!
+log file /data/osmo-stp.log
+  logging filter all 1
+  logging color 0
+  logging print category 1
+  logging timestamp 1
+  logging level all everything
+  logging level lglobal notice
+  logging level llapd notice
+  logging level linp debug
+  logging level lmux notice
+  logging level lmi notice
+  logging level lmib notice
+  logging level lsms notice
+  logging level lctrl notice
+  logging level lgtp notice
+  logging level lstats notice
+  logging level lgsup notice
+  logging level loap notice
+  logging level lss7 debug
+  logging level lsccp debug
+  logging level lsua debug
+  logging level lm3ua debug
+!
+line vty
+ no login
+ bind 0.0.0.0
+!
+cs7 instance 0
+ xua rkm routing-key-allocation dynamic-permitted
+ listen m3ua 2905
+  accept-asp-connections dynamic-permitted
+  local-ip 192.168.42.10
diff --git a/osmo-cn-latest/run.sh b/osmo-cn-latest/run.sh
new file mode 100755
index 0000000..d7bba95
--- /dev/null
+++ b/osmo-cn-latest/run.sh
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+. ../jenkins-common.sh
+
+docker_images_require \
+	"osmo-cn-latest"
+
+docker network create --subnet 192.168.42.0/24 $NET_NAME
+
+mkdir $VOL_BASE_DIR/osmo-cn
+cp osmo-stp.cfg $VOL_BASE_DIR/osmo-cn/
+cp osmo-msc.cfg $VOL_BASE_DIR/osmo-cn/
+cp osmo-hlr.cfg $VOL_BASE_DIR/osmo-cn/
+cp osmo-mgw.cfg $VOL_BASE_DIR/osmo-cn/
+cp osmo-sgsn.cfg $VOL_BASE_DIR/osmo-cn/
+cp osmo-ggsn.cfg $VOL_BASE_DIR/osmo-cn/
+cp hlr.db $VOL_BASE_DIR/osmo-cn/
+
+echo Starting Osmocom core services
+docker run	--rm \
+		--cap-add=NET_ADMIN \
+		--device /dev/net/tun:/dev/net/tun \
+	    	--network $NET_NAME --ip 192.168.42.10 \
+		-p 0.0.0.0:23000:23000/udp \
+		-v $VOL_BASE_DIR/osmo-cn:/data \
+	       	--name osmo-cn \
+	       	$REPO_USER/osmo-cn-latest
+
+echo Stopping containers
+
+docker container kill osmo-cn
+
+network_remove
diff --git a/osmo-cn-latest/runit/ggsn-run b/osmo-cn-latest/runit/ggsn-run
new file mode 100755
index 0000000..db050f9
--- /dev/null
+++ b/osmo-cn-latest/runit/ggsn-run
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
+exec /usr/bin/osmo-ggsn -c /data/osmo-ggsn.cfg
diff --git a/osmo-cn-latest/runit/hlr-run b/osmo-cn-latest/runit/hlr-run
new file mode 100755
index 0000000..c093d13
--- /dev/null
+++ b/osmo-cn-latest/runit/hlr-run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/osmo-hlr -c /data/osmo-hlr.cfg -l /data/hlr.db
diff --git a/osmo-cn-latest/runit/mgw-run b/osmo-cn-latest/runit/mgw-run
new file mode 100755
index 0000000..fbbcbc8
--- /dev/null
+++ b/osmo-cn-latest/runit/mgw-run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/osmo-mgw -c /data/osmo-mgw.cfg
diff --git a/osmo-cn-latest/runit/msc-run b/osmo-cn-latest/runit/msc-run
new file mode 100755
index 0000000..368aefa
--- /dev/null
+++ b/osmo-cn-latest/runit/msc-run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/osmo-msc -c /data/osmo-msc.cfg
diff --git a/osmo-cn-latest/runit/sgsn-run b/osmo-cn-latest/runit/sgsn-run
new file mode 100755
index 0000000..698024b
--- /dev/null
+++ b/osmo-cn-latest/runit/sgsn-run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/osmo-sgsn -c /data/osmo-sgsn.cfg
diff --git a/osmo-cn-latest/runit/stp-run b/osmo-cn-latest/runit/stp-run
new file mode 100755
index 0000000..c52c739
--- /dev/null
+++ b/osmo-cn-latest/runit/stp-run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/osmo-stp -c /data/osmo-stp.cfg

-- 
To view, visit https://gerrit.osmocom.org/13438
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Icfddc75447fbd94f9d5c19408ccc7f3a914e083f
Gerrit-Change-Number: 13438
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Willmann <dwillmann at sysmocom.de>
Gerrit-Reviewer: Daniel Willmann <dwillmann at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190329/7dece908/attachment.html>


More information about the gerrit-log mailing list