Merge "Add ICN Bluval support"
[validation.git] / docker / helm / 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 ARG HELM_TAG=v2.15.1
21
22 # Install dependencies
23 COPY pip-requirements.txt /wheels/requirements/pip-requirements.txt
24 RUN apk --no-cache add --update \
25         gcc \
26         git \
27         libc-dev \
28         libffi \
29         libffi-dev \
30         make \
31         openssl-dev
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 RUN git clone -b $HELM_TAG https://github.com/helm/helm.git /opt/helm
39
40 # Copy binaries in the final container and install requirements
41 FROM python:3.6-alpine3.9
42 COPY --from=build /wheels /wheels
43 COPY --from=build /opt/akraino/validation /opt/akraino/validation
44 COPY --from=build /opt/helm/docs/examples/alpine /opt/akraino/bluval-test-alpine
45
46 RUN pip3 install -r /wheels/requirements/pip-requirements.txt \
47                  -f /wheels && \
48      rm -rf /wheels && \
49      rm -rf /root/.cache/pip/*
50
51 # Install blueval dependencies
52 RUN pip install -r /opt/akraino/validation/bluval/requirements.txt