Newer
Older
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
FROM alpine:latest
# Install dependencies
RUN apk update && \
apk add --no-cache autoconf automake sudo make git g++ diffutils expect openssl-dev libxml2-dev libxml2-utils libxslt-dev libtool ncurses-dev jsoncpp-dev readline-dev flex bison perl libexecinfo-dev bash libedit libedit-dev lksctp-tools lksctp-tools-dev libpcap-dev
# Create user and sudouser
RUN \
addgroup -g 1000 etsi && \
adduser -S -D -u 1000 -G etsi -h /home/etsi -s /bin/bash etsi && \
echo "etsi:etsi" | chpasswd && \
echo "etsi ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers || exit 1
USER etsi
# Setup Hosts file at the boot time
RUN \
echo 'sudo sh -c "cp /etc/hosts /etc/append && (echo \"127.0.1.1 $HOSTNAME\"; cat /etc/append) > /etc/hosts"' >> /home/etsi/.bashrc \
echo 'sh' >> /home/etsi/.bashrc || exit 1
# Clone OSIP
WORKDIR /home/etsi
RUN \
mkdir -p frameworks dev tmp && cd frameworks \
&& cd ${HOME}/frameworks \
&& git clone https://git.savannah.gnu.org/git/osip.git ./osip \
&& cd osip \
&& ./autogen.sh \
&& ./configure --prefix=/home/etsi \
&& make && make install \
&& cd - || exit 1
# Clone Titan
RUN git clone https://github.com/eclipse/titan.core.git || exit 1
WORKDIR /home/etsi/frameworks/titan.core/
# Setup ENV variables
ENV TTCN3_DIR=/home/etsi/frameworks/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH \
LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH
# Set flags
RUN \
echo "ALPINE_LINUX=yes" > Makefile.personal && \
echo "TTCN3_DIR=$TTCN3_DIR" >> Makefile.personal && \
echo "JNI=no" >> Makefile.personal && \
echo "GUI=no" >> Makefile.personal && \
echo "DEBUG=no" >> Makefile.personal || exit 1
# Build Titan
RUN \
sed --in-place 's/LINUX_LIBS := -lxml2/LINUX_LIBS := -lxml2 -lpthread/g' ./core/Makefile && \
make install && make clean || exit 1
WORKDIR /home/etsi/dev
EXPOSE 443/tcp
EXPOSE 5060/udp
EXPOSE 5061/udp
ENTRYPOINT /home/yann/dev/cise/virtualization/docker/docker-entrypoint.sh