Fix Sonobuoy systemd-image for k8 1.18
[validation.git] / docker / services / 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.10.0b1-alpine3.13 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         build-base \
25         cairo \
26         cairo-dev \
27         cargo \
28         curl \
29         freetype-dev \
30         gcc \
31         gdk-pixbuf-dev \
32         gettext \
33         git \
34         jpeg-dev \
35         lcms2-dev \
36         libffi-dev \
37         musl-dev \
38         openjpeg-dev \
39         openssl-dev \
40         pango-dev \
41         poppler-utils \
42         postgresql-client \
43         postgresql-dev \
44         py-cffi \
45         python3-dev \
46         rust \
47         tcl-dev \
48         tiff-dev \
49         tk-dev \
50         zlib-dev
51
52 # Build binaries
53 WORKDIR /wheels
54 RUN pip3 install wheel
55 RUN pip3 wheel -r /wheels/requirements/pip-requirements.txt
56 RUN git clone https://gerrit.akraino.org/r/validation /opt/akraino/validation
57
58 # Copy binaries in the final contaier and install robot framework
59 FROM python:3.10.0b1-alpine3.13
60 COPY --from=build /wheels /wheels
61 COPY --from=build /opt/akraino/validation /opt/akraino/validation
62
63 RUN apk --no-cache add --update \
64         build-base \
65         cairo \
66         cairo-dev \
67         cargo \
68         curl \
69         freetype-dev \
70         gcc \
71         gdk-pixbuf-dev \
72         gettext \
73         git \
74         jpeg-dev \
75         lcms2-dev \
76         libffi-dev \
77         musl-dev \
78         openjpeg-dev \
79         openssl-dev \
80         pango-dev \
81         poppler-utils \
82         postgresql-client \
83         postgresql-dev \
84         py-cffi \
85         python3-dev \
86         rust \
87         tcl-dev \
88         tiff-dev \
89         tk-dev \
90         zlib-dev
91
92 RUN pip3 install -r /wheels/requirements/pip-requirements.txt \
93                  -f /wheels && \
94      rm -rf /wheels && \
95      rm -rf /root/.cache/pip/*
96
97 # Install blueval dependencies
98 RUN pip install -r /opt/akraino/validation/bluval/requirements.txt
99
100 # Install curl
101 RUN apk --no-cache add --update \
102         curl