X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=docker%2Fdocker%2FDockerfile;fp=docker%2Fdocker%2FDockerfile;h=82c70403be29ef2f249643014c55ebeb92c3ccd7;hb=3d693bf57ea1a831f90a655929b8fe4502de50a8;hp=0000000000000000000000000000000000000000;hpb=04ef9a01ce5518e41e4f4c3c43ef37fdb9a18dca;p=validation.git diff --git a/docker/docker/Dockerfile b/docker/docker/Dockerfile new file mode 100644 index 0000000..82c7040 --- /dev/null +++ b/docker/docker/Dockerfile @@ -0,0 +1,50 @@ +############################################################################## +# Copyright (c) 2019 AT&T, ENEA AB, Nokia and others # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you maynot use this file except in compliance with the License. # +# # +# You may obtain a copy of the License at # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +############################################################################## + +# ref: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#use-multi-stage-builds +FROM python:3.6-alpine3.9 as build + +# Install dependencies +COPY pip-requirements.txt /wheels/requirements/pip-requirements.txt +RUN apk --no-cache add --update \ + gcc \ + git \ + libc-dev \ + libffi \ + libffi-dev \ + make \ + openssl-dev + +# Build binaries +WORKDIR /wheels +RUN pip3 install wheel +RUN pip3 wheel -r /wheels/requirements/pip-requirements.txt +RUN git clone https://gerrit.akraino.org/r/validation /opt/akraino/validation +RUN git clone https://github.com/docker/docker-bench-security.git /opt/akraino/docker-bench-security + +# Copy binaries in the final container and install requirements +FROM python:3.6-alpine3.9 +COPY --from=build /wheels /wheels +COPY --from=build /opt/akraino/validation /opt/akraino/validation +COPY --from=build /opt/akraino/docker-bench-security /opt/akraino/docker-bench-security + +RUN pip3 install -r /wheels/requirements/pip-requirements.txt \ + -f /wheels && \ + rm -rf /wheels && \ + rm -rf /root/.cache/pip/* + +# Install blueval dependencies +RUN pip install -r /opt/akraino/validation/bluval/requirements.txt