[bugfix] no ansible requirements when build docker image
[yardstick.git] / docker / Dockerfile
1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 FROM ubuntu:16.04
11
12 LABEL image=opnfv/yardstick
13
14 ARG BRANCH=master
15 ARG OPENSTACK_TAG=stable/stein
16
17 # GIT repo directory
18 ENV REPOS_DIR="/home/opnfv/repos" \
19     IMAGE_DIR="/home/opnfv/images/"
20
21 # Set work directory
22
23 # Yardstick repo
24 ENV YARDSTICK_REPO_DIR="${REPOS_DIR}/yardstick/" \
25     RELENG_REPO_DIR="${REPOS_DIR}/releng" \
26     STORPERF_REPO_DIR="${REPOS_DIR}/storperf"
27
28 RUN apt-get update && apt-get install -y git python python-setuptools python-pip iputils-ping && apt-get -y autoremove && apt-get clean
29 RUN easy_install -U setuptools==30.0.0
30 RUN pip install \
31         -chttps://opendev.org/openstack/requirements/raw/branch/$OPENSTACK_TAG/upper-constraints.txt \
32         -chttps://git.opnfv.org/yardstick/plain/upper-constraints.txt?h=$BRANCH \
33         appdirs==1.4.0 pyopenssl==17.5.0 openstacksdk==0.11.3 python-heatclient==1.14.0 ansible==2.5.5
34
35 RUN mkdir -p ${REPOS_DIR}
36
37 RUN git config --global http.sslVerify false
38 #For developers: To test your changes you must comment out the git clone for ${YARDSTICK_REPO_DIR}.
39 #You must also uncomment the RUN and COPY commands below.
40 #You must run docker build from your yardstick directory on the host.
41 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/yardstick ${YARDSTICK_REPO_DIR}
42 #RUN mkdir ${YARDSTICK_REPO_DIR}
43 #COPY ./ ${YARDSTICK_REPO_DIR}
44 RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${RELENG_REPO_DIR}
45 RUN git clone --depth 1 -b stable/gambia https://gerrit.opnfv.org/gerrit/storperf ${STORPERF_REPO_DIR}
46
47 RUN ansible-playbook -i ${YARDSTICK_REPO_DIR}/ansible/install-inventory.ini -c local -vvv -e INSTALLATION_MODE="container" ${YARDSTICK_REPO_DIR}/ansible/install.yaml
48
49 RUN ${YARDSTICK_REPO_DIR}/docker/supervisor.sh
50
51 RUN echo "daemon off;" >> /etc/nginx/nginx.conf
52 # nginx=5000, rabbitmq=5672
53 EXPOSE 5000 5672
54
55 ADD http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img ${IMAGE_DIR}
56 ADD http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img ${IMAGE_DIR}
57
58 # For developers: when `docker build ...` is running from YARDSTICK_REPO_DIR, please change
59 #                 path `./exec_tests.sh` -> `./docker/exec_tests.sh``.
60 COPY ./exec_tests.sh /usr/local/bin/
61
62 ENV NSB_DIR="/opt/nsb_bin"
63 ENV PYTHONPATH="${PYTHONPATH}:${NSB_DIR}/trex_client:${NSB_DIR}/trex_client/stl"
64
65 WORKDIR ${REPOS_DIR}
66 CMD ["/usr/bin/supervisord"]