Merge "KVMFORNFV: Update Grafana config for Packet Forwarding test cases."
[yardstick.git] / ansible / roles / create_dockerfile / templates / ubuntu / 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
16 # GIT repo directory
17 ENV REPOS_DIR /home/opnfv/repos
18
19 # Yardstick repo
20 ENV YARDSTICK_REPO_DIR ${REPOS_DIR}/yardstick
21 ENV RELENG_REPO_DIR ${REPOS_DIR}/releng
22 RUN sed -i -e 's/^deb /deb [arch=amd64] /g;s/^deb-src /# deb-src /g' /etc/apt/sources.list && \
23     echo "\n\
24 deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty main universe multiverse restricted \n\
25 deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main universe multiverse restricted \n\
26 deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-security main universe multiverse restricted \n\
27 deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-proposed main universe multiverse restricted" >> /etc/apt/sources.list && \
28     dpkg --add-architecture arm64
29
30 # WHY? Is this workaround still needed?
31 # https://wiki.debian.org/mmap_min_addr#apps
32 # qemu, as shipped in Debian 5.0, requires low virtual memory mmaps. mmap_min_addr must be set to 0 to run qemu as a non-root user. This limitation has been removed upstream, so qemu should work with an increased mmap_min_addr starting with Debian squeeze.
33 #RUN echo "vm.mmap_min_addr = 0" > /etc/sysctl.d/mmap_min_addr.conf
34
35 # This will prevent questions from being asked during the install
36 ENV DEBIAN_FRONTEND=noninteractive
37 RUN apt-get update && apt-get install -y \
38     qemu-user-static \
39     libc6:arm64 \
40     wget \
41     expect \
42     curl \
43     git \
44     sshpass \
45     qemu-utils \
46     kpartx \
47     libffi-dev \
48     libssl-dev \
49     libzmq-dev \
50     python \
51     python-dev \
52     libxml2-dev \
53     libxslt1-dev \
54     nginx \
55     uwsgi \
56     uwsgi-plugin-python \
57     supervisor \
58     python-setuptools && \
59     easy_install -U setuptools==30.0.0 && \
60     apt-get -y autoremove && \
61     apt-get clean
62
63 RUN mkdir -p ${REPOS_DIR} && \
64     git config --global http.sslVerify false && \
65     git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/yardstick ${YARDSTICK_REPO_DIR}  && \
66     git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${RELENG_REPO_DIR}
67
68 # install yardstick + dependencies
69 # explicity pin pip version to avoid future issues like the ill-fated pip 8.0.0 release
70 RUN easy_install -U "pip==${PIP_VERSION}" && \
71     pip install -r ${YARDSTICK_REPO_DIR}/requirements.txt && \
72     pip install ${YARDSTICK_REPO_DIR}
73
74 RUN ${YARDSTICK_REPO_DIR}/api/api-prepare.sh
75
76 EXPOSE 5000
77
78 ADD http://download.cirros-cloud.net/0.3.3/cirros-0.3.5-x86_64-disk.img /home/opnfv/images/
79 ADD http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img /home/opnfv/images/
80
81 COPY ./exec_tests.sh /usr/local/bin/
82 CMD ["/usr/bin/supervisord"]