165c8a7b27ca9dd39ffb3fd745baceb8f8702894
[functest.git] / docker / core / Dockerfile
1 FROM alpine:3.6
2
3 ARG BRANCH=master
4 ARG OPENSTACK_TAG=stable/pike
5 ARG RALLY_TAG=stable/0.10
6 ARG OS_FAULTS_TAG=0.1.16
7
8 RUN apk --no-cache add --update \
9         python libffi libssl1.0 libjpeg-turbo py-pip bash \
10         grep sed wget ca-certificates git openssh-client && \
11     apk --no-cache add --virtual .build-deps --update \
12         python-dev build-base linux-headers libffi-dev \
13         openssl-dev libjpeg-turbo-dev && \
14     wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
15         sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest@\\1#egg=tempest/ \
16         > upper-constraints.txt && \
17     git clone https://gerrit.opnfv.org/gerrit/functest /src/functest && \
18     (cd /src/functest && git fetch origin $BRANCH && git checkout FETCH_HEAD) && \
19     pip install --no-cache-dir --src /src -cupper-constraints.txt \
20         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
21         -e git+https://github.com/openstack/requirements@$OPENSTACK_TAG#egg=openstack_requirements && \
22     git clone --depth 1 https://github.com/openstack/os-faults.git -b $OS_FAULTS_TAG /src/os-faults && \
23     update-requirements -s --source /src/openstack-requirements /src/os-faults/ && \
24     git clone --depth 1 https://github.com/openstack/rally.git -b $RALLY_TAG /src/rally && \
25     update-requirements -s --source /src/openstack-requirements /src/rally/ && \
26     pip install --no-cache-dir --src /src -cupper-constraints.txt \
27         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
28          /src/os-faults /src/rally && \
29     pip install --no-cache-dir --src /src -cupper-constraints.txt \
30         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
31         /src/functest && \
32     rm -r upper-constraints.txt /src/functest /src/os-faults/.git /src/rally/.git && \
33     mkdir -p /etc/rally && \
34     printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
35     mkdir -p /var/lib/rally/database && rally-manage db create && \
36     bash -c "mkdir -p /home/opnfv/functest{/conf,/data,/images,/results} /home/opnfv/repos/vnfs" && \
37     apk del .build-deps