Dockerfile.upf-vpp.ubuntu18 4.27 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements.  See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1  (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# *      http://www.openairinterface.org/?page_id=698
# *
Rohan's avatar
Rohan committed
12
13
14
15
16
17
18
19
20
21
22
# * 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.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# *      contact@openairinterface.org
# */
#---------------------------------------------------------------------
#
Rohan's avatar
Rohan committed
23
# Dockerfile for the VPP-UPF service
Rohan's avatar
Rohan committed
24
25
26
27
28
29
30
31
32
33
#   Valid for Ubuntu-18.04 (bionic)
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------

FROM ubuntu:18.04 AS vpp-upf-builder

ARG NEEDED_GIT_PROXY
Raphael Defosseux's avatar
Raphael Defosseux committed
34
35
ENV DEBIAN_FRONTEND=noninteractive

Rohan's avatar
Rohan committed
36
# Installing hyperscan library for upf plugin
Raphael Defosseux's avatar
Raphael Defosseux committed
37
38
39
40
41
RUN apt update && \
    DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
    DEBIAN_FRONTEND=noninteractive apt-get install --yes \
        git \
        sudo \
Raphael Defosseux's avatar
Raphael Defosseux committed
42
        python3 \
Raphael Defosseux's avatar
Raphael Defosseux committed
43
44
45
46
47
48
        wget \
        make \
        build-essential \
        libhyperscan-dev \
  && rm -rf /var/lib/apt/lists/*

Rohan's avatar
Rohan committed
49
50

# Some GIT configuration commands quite useful
Raphael Defosseux's avatar
Raphael Defosseux committed
51
52
53
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
RUN git config --global https.postBuffer 123289600 && \
    git config --global http.sslverify false
Rohan's avatar
Rohan committed
54

Rohan's avatar
Rohan committed
55
56
WORKDIR /vpp-upf
COPY scripts/ /vpp-upf/scripts
Rohan's avatar
Rohan committed
57

Rohan's avatar
Rohan committed
58
# Applying vpp patches
Raphael Defosseux's avatar
Raphael Defosseux committed
59
60
61
62
63
64
65
66
67
68
69
70
71
RUN git clone -b stable/2101 https://github.com/fdio/vpp.git && \
    git clone https://github.com/travelping/upg-vpp.git && \
    # For the moment let us fix a given commit
    cd upg-vpp && \
    git checkout -f 4d32e1721c1e9a1bd7ea861658f502a64f9b4073 && \
    cd .. && \
    mv upg-vpp/upf/ vpp/src/plugins/ && \
    mv upg-vpp/vpp-patches/* scripts/patches/ && \
    mv upg-vpp/vpp.spec / && \
    ./scripts/apply_vpp_patches.sh && \
    touch /etc/apt/apt.conf.d/90forceyes && \
    echo  "APT::Get::Assume-Yes "true";" >> /etc/apt/apt.conf.d/90forceyes && \
    echo  "APT::Get::force-yes "true";" >> /etc/apt/apt.conf.d/90forceyes
Rohan's avatar
Rohan committed
72
73
74
75
76

# To Do - remove unnecessary pulgin build to optimise build time e.g. ipsec, dpdk etc.

# Build vpp with travelping upf plugin
RUN make install-dep build-release -C vpp
Rohan's avatar
Rohan committed
77
78
79
80

#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
Raphael Defosseux's avatar
Raphael Defosseux committed
81
FROM ubuntu:bionic as oai-upf-vpp
Rohan's avatar
Rohan committed
82
ENV DEBIAN_FRONTEND=noninteractive
Rohan's avatar
Rohan committed
83
ENV TZ=Europe/Paris
Raphael Defosseux's avatar
Raphael Defosseux committed
84

Raphael Defosseux's avatar
Raphael Defosseux committed
85
86
87
88
89
90
91
92
93
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
    DEBIAN_FRONTEND=noninteractive apt-get install --yes \
        net-tools \
        tshark \
        tzdata\
        openssl \
        libhyperscan-dev \
        iproute2 \
Rohan's avatar
Rohan committed
94
        iputils-ping \
Raphael Defosseux's avatar
Raphael Defosseux committed
95
        vim \
Rohan's avatar
Rohan committed
96
97
  && rm -rf /var/lib/apt/lists/*

98
99
100
101
WORKDIR /openair-upf/bin
COPY --from=vpp-upf-builder /vpp-upf/scripts/entrypoint.sh .
COPY --from=vpp-upf-builder /vpp-upf/vpp/build-root/install-vpp-native/vpp/bin/vpp .
COPY --from=vpp-upf-builder /vpp-upf/vpp/build-root/install-vpp-native/vpp/bin/vppctl .
Rohan's avatar
Rohan committed
102

Rohan's avatar
Rohan committed
103
WORKDIR /openair-upf/etc
104
105
COPY --from=vpp-upf-builder /vpp-upf/scripts/upf_conf/init.conf .
COPY --from=vpp-upf-builder /vpp-upf/scripts/upf_conf/startup_debug.conf .
Rohan's avatar
Rohan committed
106
107

WORKDIR /usr/lib/x86_64-linux-gnu/
Rohan's avatar
Rohan committed
108
COPY --from=vpp-upf-builder /vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/ .
109

Rohan's avatar
Rohan committed
110
RUN ldconfig
111

Rohan's avatar
Rohan committed
112
113
RUN groupadd vpp

114
115
WORKDIR /openair-upf
COPY --from=vpp-upf-builder /vpp-upf/scripts/run.sh  .
Rohan's avatar
Rohan committed
116
117

#expose
118
EXPOSE 8085/udp 2152/udp
Rohan's avatar
Rohan committed
119

Rohan's avatar
Rohan committed
120
121
ENTRYPOINT ["/openair-upf/bin/entrypoint.sh"]
CMD ["/openair-upf/run.sh"]