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