-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile
55 lines (44 loc) · 2.45 KB
/
Dockerfile
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
FROM phusion/baseimage:latest
MAINTAINER George Vagenas - [email protected]
MAINTAINER Jean Deruelle - [email protected]
MAINTAINER Lefteris Banos - [email protected]
MAINTAINER Gennadiy Dubina - [email protected]
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
### install java and etc ###
ENV DEBIAN_FRONTEND noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
RUN locale-gen en_US en_US.UTF-8 && dpkg-reconfigure locales
RUN add-apt-repository ppa:webupd8team/java -y
RUN apt-get update && apt-get install -y wget ipcalc bsdtar oracle-java8-installer openssl unzip tcpdump net-tools && apt-get autoremove && apt-get autoclean && rm -rf /var/lib/apt/lists/*
### end ###
# create work dir
ENV LOADER_BALANCER_DIR /opt/loadbalancer
ENV LOADER_BALANCER_CONFIG /opt/loadbalancer/config/lb-configuration.xml
ENV LOG4J_CONFIG ${LOADER_BALANCER_DIR}/lb-log4j.xml
RUN mkdir -p ${LOADER_BALANCER_DIR}
RUN mkdir -p ${LOADER_BALANCER_DIR}/utils
RUN mkdir -p ${LOADER_BALANCER_DIR}/config
RUN wget -qO- https://mobicents.ci.cloudbees.com/view/RestComm/job/RestComm-LoadBalancer/lastSuccessfulBuild/artifact/load-balancer-version.txt -O version.txt
RUN wget -qc https://mobicents.ci.cloudbees.com/view/RestComm/job/RestComm-LoadBalancer/lastSuccessfulBuild/artifact/jar/target/sip-balancer-jar-`cat version.txt`-jar-with-dependencies.jar -O ${LOADER_BALANCER_DIR}/sip-balancer.jar && mv version.txt ${LOADER_BALANCER_DIR}
# copy loadbalancer files
ADD ./files/lb-configuration.xml ${LOADER_BALANCER_CONFIG}
ADD ./files/keystore.jks ${LOADER_BALANCER_DIR}/config/keystore.jks
ADD ./files/utils/read-network-props.sh ${LOADER_BALANCER_DIR}/utils/read-network-props.sh
ADD ./files/lb-log4j.xml ${LOG4J_CONFIG}
# add configuration scripts
RUN mkdir -p /etc/my_init.d
ADD ./scripts/remote_config_downloader.sh /etc/my_init.d/loadbalancer1_remote.sh
ADD ./scripts/configure_load_balancer.sh /etc/my_init.d/loadbalancer2_configure.sh
#Add traces crontab cleanup file.
ADD ./cron_file/tcpdump_crontab /etc/cron.d/lbtcpdump-cron
#Add traces crontab cleanup file.
ADD ./cron_file/lb_crontab /etc/cron.d/lblogs-cron
# create start script
ENV service_path /etc/service/loadbalancer
RUN mkdir ${service_path}
ADD ./files/start_loadbalancer.sh ${service_path}/run
# expose default rmi ports
EXPOSE 2000/tcp
EXPOSE 2001/tcp