1 ##############################################################################
2 # Copyright (c) 2019 AT&T, ENEA AB, Nokia and others #
4 # Licensed under the Apache License, Version 2.0 (the "License"); #
5 # you maynot use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
8 # http://www.apache.org/licenses/LICENSE-2.0 #
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 ##############################################################################
17 # ref: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#use-multi-stage-builds
18 FROM ubuntu:18.04 as build
20 # Install dependencies
21 COPY pip-requirements.txt /wheels/requirements/pip-requirements.txt
22 RUN apt-get update && apt-get -y install \
32 autoconf automake autotools-dev m4 \
33 linux-headers-generic \
34 libaio-dev libattr1-dev libcap-dev
38 RUN pip3 install wheel
39 RUN pip3 wheel -r /wheels/requirements/pip-requirements.txt
40 RUN git clone https://gerrit.akraino.org/r/validation /opt/akraino/validation
43 RUN mkdir -p /opt/akraino /root/src
45 RUN git clone https://github.com/linux-test-project/ltp.git
47 RUN make autotools && \
48 ./configure --prefix=/opt/ltp && \
49 make -j $(getconf _NPROCESSORS_ONLN) 2>&1 | tee ../build-log.txt && \
50 make install 2>&1 | tee ../install-log.txt
51 RUN tar czvf /opt/akraino/ltp.tar.gz /opt/ltp
53 # Copy binaries into the final container and install robot framework
55 COPY --from=build /wheels /wheels
56 COPY --from=build /opt/akraino/validation /opt/akraino/validation
57 COPY --from=build /opt/akraino/ltp.tar.gz /opt/akraino/ltp.tar.gz
59 RUN apt-get update && apt-get -y install \
60 python3-pip python3.6 && \
61 cd /usr/bin && ln -s python3 python && \
62 pip3 install -r /wheels/requirements/pip-requirements.txt \
65 rm -rf /root/.cache/pip/* && \
66 rm -rf /var/cache/apt/* && \
67 rm -rf /var/lib/apt/lists/*
69 # Install bluval dependencies
70 RUN pip3 install -r /opt/akraino/validation/bluval/requirements.txt