summaryrefslogtreecommitdiffstats
path: root/docker/storperf-master/Dockerfile
blob: 38bd2314dd1c189939d47731ca5673c0f2db39e5 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
##############################################################################
# Copyright (c) 2015 EMC and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
#   Docker container for STORPERF
#
# Purpose: docker image for Storperf project
#
# Maintained by Jose Lausuch, Mark Beierl
# Build:
#    $ docker build -t opnfv/storperf-master:tag .
#

ARG ARCH
ARG ALPINE_VERSION=v3.6
FROM multiarch/alpine:$ARCH-$ALPINE_VERSION as storperf-builder

LABEL version="5.0" description="OPNFV Storperf Docker container"

ARG BRANCH=master

ENV repos_dir /home/opnfv/repos

RUN apk --no-cache add --update \
    git \
    alpine-sdk \
    linux-headers \
    libaio \
    libaio-dev \
    zlib-dev

# Third party git fetches
RUN git config --global http.sslVerify false
RUN git clone http://git.kernel.dk/fio.git ${repos_dir}/fio
RUN cd ${repos_dir}/fio && git checkout tags/fio-2.99
RUN cd ${repos_dir}/fio && EXTFLAGS="-static" make install

# Build StorPerf

RUN apk --no-cache add --update \
    libffi-dev \
    libressl-dev \
    python \
    py-pip \
    python-dev \
    alpine-sdk \
    linux-headers \
    bash

# Install StorPerf

COPY requirements.pip /storperf/
RUN pip install --upgrade setuptools==33.1.1
RUN pip install -r /storperf/requirements.pip

# Build stripped down StorPerf image

FROM multiarch/alpine:$ARCH-$ALPINE_VERSION as storperf-master

RUN apk --no-cache add --update \
    python \
    bash

COPY --from=storperf-builder /usr/lib/python2.7/site-packages /usr/lib/python2.7/site-packages
COPY --from=storperf-builder /usr/local/bin/fio /usr/local/bin/fio
COPY . /storperf

WORKDIR /storperf
RUN chmod 600 storperf/resources/ssh/storperf_rsa

# ReST API

EXPOSE 5000

# Entry point
CMD [ "python", "./rest_server.py" ]