Add Dockerfile for building the library
[o-du/phy.git] / Dockerfile
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #                                                                              #
4 #   Licensed under the Apache License, Version 2.0 (the "License");            #
5 #   you may not use this file except in compliance with the License.           #
6 #   You may obtain a copy of the License at                                    #
7 #                                                                              #
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,          #
12 #   WITHOUT 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 FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu16-c-go:2-u16.04-nng as ubuntu
17
18 WORKDIR /opt/o-du/phy
19 COPY . .
20
21 ENV XRAN_DIR /opt/o-du/phy/fhi_lib
22 ENV BUILD_GCC 1
23
24 RUN apt-get update &&\
25     apt-get install -y wget libnuma-dev linux-headers-generic libgtest-dev
26 # because we run in VM which may be linuxkit kernel.  Faking for "regular" kernel
27 RUN cp -r /lib/modules/$(ls -1 /lib/modules | head -1) /lib/modules/$(uname -r)
28
29 RUN wget https://github.com/google/googletest/archive/v1.8.x.zip && \
30     unzip v1.8.x.zip
31 ENV GTEST_ROOT /opt/o-du/phy/googletest-1.8.x
32
33 ENV RTE_TARGET x86_64-native-linuxapp-gcc
34 ENV RTE_SDK /opt/o-du/dpdk-18.08
35 RUN wget http://fast.dpdk.org/rel/dpdk-18.08.1.tar.xz && \
36     tar -xf dpdk-18.08.1.tar.xz && \
37     mv dpdk-stable-18.08.1 $RTE_SDK && \
38     cd $RTE_SDK && \
39     make install T="$RTE_TARGET"
40
41 RUN cd fhi_lib/lib && \
42     bash ./build_ci.sh