os: vuls: Add CentOS 8 support
[validation.git] / docker / hardware / Dockerfile
1 ##############################################################################
2 # Copyright (c) 2019 AT&T, ENEA AB, Nokia and others                         #
3 #                                                                            #
4 # Licensed under the Apache License, Version 2.0 (the "License");            #
5 # you maynot use this file except in compliance with the License.            #
6 #                                                                            #
7 # You may obtain a copy of the License at                                    #
8 #       http://www.apache.org/licenses/LICENSE-2.0                           #
9 #                                                                            #
10 # Unless required by applicable law or agreed to in writing, software        #
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT  #
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.           #
13 # See the License for the specific language governing permissions and        #
14 # limitations under the License.                                             #
15 ##############################################################################
16
17 # ref: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#use-multi-stage-builds
18 FROM python:3.6-alpine3.9 as build
19
20 # Install dependencies
21 COPY pip-requirements.txt /wheels/requirements/pip-requirements.txt
22
23 RUN apk --no-cache add --update \
24         gcc \
25         git \
26         libc-dev \
27         libffi \
28         libffi-dev \
29         make \
30         openssl-dev \
31         wget
32
33 # Build binaries
34 WORKDIR /wheels
35 RUN pip3 install wheel
36 RUN pip3 wheel -r /wheels/requirements/pip-requirements.txt
37 RUN git clone https://gerrit.akraino.org/r/validation /opt/akraino/validation
38
39 RUN wget -qO- https://github.com/DMTF/Redfish-Test-Framework/archive/master.zip | \
40     unzip -qd /opt/akraino -
41 RUN wget -qO- https://github.com/DMTF/Redfish-Usecase-Checkers/archive/master.zip | \
42     unzip -qd /opt/akraino -
43
44 # Copy binaries in the final contaier and install robot framework
45 FROM python:3.6-alpine3.9
46 COPY --from=build /wheels /wheels
47 COPY --from=build /opt/akraino/validation /opt/akraino/validation
48 COPY --from=build /opt/akraino/Redfish-Test-Framework-master /opt/akraino/Redfish-Test-Framework
49 COPY --from=build /opt/akraino/Redfish-Usecase-Checkers-master /opt/akraino/Redfish-Usecase-Checkers
50
51 RUN pip3 install -r /wheels/requirements/pip-requirements.txt \
52                  -f /wheels && \
53      rm -rf /wheels && \
54      rm -rf /root/.cache/pip/*
55
56 # Install blueval dependencies
57 RUN pip install -r /opt/akraino/validation/bluval/requirements.txt
58
59 # Install Redfish dependencies
60 RUN pip install html-testRunner \
61                 -r /opt/akraino/Redfish-Usecase-Checkers/requirements.txt
62
63 # Install curl
64 RUN apk --no-cache add --update \
65         curl