aboutsummaryrefslogtreecommitdiffstats
path: root/osmo-remsim-master/Dockerfile
blob: bed7f47e52e929200b5e41ff393d9e581c8066fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
ARG	USER
ARG	DISTRO
FROM	$USER/$DISTRO-build
# Arguments used after FROM must be specified again
ARG	DISTRO

MAINTAINER Harald Welte <laforge@gnumonks.org>

# PC/SC required for testing of bankd (with vpcd)
# autoconf, automake, libtool, pkg-config, m4, help2man required for virtualsmartcard
RUN	case "$DISTRO" in \
	debian*) \
		apt-get update && \
		apt-get install -y --no-install-recommends \
			libpcsclite-dev \
			pcscd \
			pcsc-tools \
			autoconf automake libtool pkg-config m4 help2man ca-certificates && \
		apt-get clean \
		;; \
	centos*) \
		dnf install -y \
			pcsc-lite \
			help2man \
			python3 \
		;; \
	esac

# build virtualsmartcard
RUN	git clone https://github.com/frankmorgner/vsmartcard.git
RUN	cd vsmartcard/virtualsmartcard && autoreconf -fi && ./configure && make -j8 install


ARG	OSMOCOM_REPO="http://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_9.0/"

COPY	Release.key /tmp/Release.key

RUN	case "$DISTRO" in \
	debian*) \
		apt-key add /tmp/Release.key && \
		rm /tmp/Release.key && \
		echo "deb " $OSMOCOM_REPO " ./" > /etc/apt/sources.list.d/osmocom-nightly.list \
		;; \
	esac

ADD	$OSMOCOM_REPO/Release /tmp/Release
RUN	case "$DISTRO" in \
	debian*) \
		apt-get update && \
		apt-get install -y --no-install-recommends \
			telnet \
			libosmocore-dev \
			libosmo-simtrace2-dev \
			libosmo-abis-dev \
			libosmo-netif-dev \
			libpcsclite-dev \
			libcsv-dev \
			libjansson-dev \
			libulfius-dev \
			liborcania-dev && \
		apt-get clean \
		;; \
	centos*) \
		dnf install -y \
			telnet \
			"pkgconfig(libasn1c)" \
			"pkgconfig(libosmoabis)" \
			"pkgconfig(libosmocore)" \
			"pkgconfig(libosmogsm)" \
			"pkgconfig(libosmosim)" \
			"pkgconfig(libpcsclite)" \
			"pkgconfig(libulfius)" \
			"pkgconfig(libusb-1.0)" \
			"pkgconfig(libosmousb)" \
			"pkgconfig(libosmo-simtrace2)" \
		;; \
	esac

#ADD	respawn.sh /usr/local/bin/respawn.sh

WORKDIR	/tmp

ARG	OSMO_REMSIM_BRANCH="master"

RUN	git clone git://git.osmocom.org/osmo-remsim.git
ADD	http://git.osmocom.org/osmo-remsim/patch?h=$OSMO_REMSIM_BRANCH /tmp/commit-osmo-remsim

RUN	cd osmo-remsim && \
	git fetch && git checkout $OSMO_REMSIM_BRANCH && \
	(git symbolic-ref -q HEAD && git reset --hard origin/$OSMO_REMSIM_BRANCH || exit 1); \
	git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \
	autoreconf -fi && \
	./configure && \
	make -j8 install && \
	ldconfig

VOLUME	/data

#COPY	osmo-bts.cfg /data/osmo-bts.cfg

WORKDIR	/data
CMD	["/bin/sh", "-c", "/usr/local/bin/osmo-resmim-server >/data/osmo-resmim-server.log 2>&1"]

#EXPOSE