Fix docker build error problem
[vfc/gvnfm/vnflcm.git] / lcm / docker / Dockerfile
1 FROM ubuntu:14.04
2
3 ARG HTTP_PROXY=${HTTP_PROXY}
4 ARG HTTPS_PROXY=${HTTPS_PROXY}
5
6 ENV http_proxy $HTTP_PROXY
7 ENV https_proxy $HTTPS_PROXY
8
9 RUN sed -i "s|set compatible|set nocompatible|" /etc/vim/vimrc.tiny
10 RUN echo "set backspace=2" >> /etc/vim/vimrc.tiny
11
12 RUN echo "mysql-server mysql-server/root_password password root" | debconf-set-selections
13 RUN echo "mysql-server mysql-server/root_password_again password root" | debconf-set-selections
14
15 RUN apt-get update && \
16     apt-get install -y python-virtualenv && \
17     apt-get install -y python-setuptools && \
18     apt-get install -y python-dev && \
19     apt-get install -y python-pip && \
20     apt-get install -y gcc && \
21     apt-get install -y libmysqlclient-dev && \
22     apt-get install -y redis-server && \
23     apt-get install -y mysql-server && \
24     apt-get install -y mysql-client && \
25     apt-get install -y wget && \
26     apt-get install -y unzip && \
27     apt-get install -y curl && \
28     apt-get install -y build-essential && \
29     apt-get install -y libssl-dev && \
30     apt-get install -y libffi-dev
31
32 ADD . /service
33 WORKDIR /service
34
35 # get binary zip from nexus
36 RUN wget -q -O vfc-gvnfm-vnflcm-lcm.zip 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.gvnfm.vnflcm.lcm&a=vfc-gvnfm-vnflcm-lcm&v=LATEST&e=zip' && \
37     unzip vfc-gvnfm-vnflcm-lcm.zip && \
38     rm -rf vfc-gvnfm-vnflcm-lcm.zip
39
40 # get db scripts from nexus
41 RUN wget -q -O vfc-gvnfm-vnfres-res.zip 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.gvnfm.vnfres.res&a=vfc-gvnfm-vnfres-res&v=LATEST&e=zip' && \
42     unzip vfc-gvnfm-vnfres-res.zip vfc/gvnfm/vnfres/res/assembly/*.* && \
43     mv ./vfc/gvnfm/vnfres/res/assembly/bin ./bin && \
44     mv ./vfc/gvnfm/vnfres/res/assembly/dbscripts ./dbscripts && \
45     rm -rf vfc-gvnfm-vnfres-res.zip
46
47 RUN sed -i "s|bind-address.*|# bind-address = 127.0.0.1|" /etc/mysql/my.cnf
48
49 VOLUME /var/lib/mysql
50
51 WORKDIR /service/vfc/gvnfm/vnflcm/lcm
52 RUN pip install -r requirements.txt
53
54 EXPOSE 8801
55 EXPOSE 3306
56 EXPOSE 6379
57
58 WORKDIR /service
59 ENTRYPOINT vfc/gvnfm/vnflcm/lcm/docker/docker-entrypoint.sh