Dockerfile.upf-vpp.rhel7 4.47 KB
Newer Older
Rohan's avatar
Rohan committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#/*
# * 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
# *
# * 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
# */
#---------------------------------------------------------------------
#
# Dockerfile for the VPP-UPG service
#   Valid for RHEL 8.2
#
#---------------------------------------------------------------------

#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi7/ubi:latest AS vpp-upg-builder

ARG NEEDED_GIT_PROXY

COPY tmp/ca/redhat-uep.pem /etc/rhsm/ca
COPY tmp/entitlement/*.pem /etc/pki/entitlement

RUN rm -f /etc/rhsm-host && \
    subscription-manager repos --enable rhel-server-rhscl-7-rpms && \
    subscription-manager repos --enable rhel-7-server-optional-rpms && \
    yum update -y && \
    yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm &&\
    yum install -y \
Rohan's avatar
Rohan committed
44
        python3 \
Rohan's avatar
Rohan committed
45
46
47
48
49
50
51
52
53
54
        psmisc \
        git \
        make \
        patch \
        sudo \
        wget && \
	rm -rf /var/lib/apt/lists/*

# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
Raphael Defosseux's avatar
Raphael Defosseux committed
55
56
RUN git config --global https.postBuffer 123289600 && \
    git config --global http.sslverify false
Rohan's avatar
Rohan committed
57
58
59
60
61

RUN wget http://repo.openfusion.net/centos7-x86_64/hyperscan-devel-5.3.0-1.of.el7.x86_64.rpm \
         http://repo.openfusion.net/centos7-x86_64/hyperscan-5.3.0-1.of.el7.x86_64.rpm \ 
         && rpm -i *.rpm

Rohan's avatar
Rohan committed
62
63
WORKDIR /vpp-upf
COPY scripts/ /vpp-upf/scripts
Rohan's avatar
Rohan committed
64
65
66
67
68
69
70
71
72
73
74
75
76
77

# Applying vpp patches
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

RUN make install-dep build-release -C vpp/
Raphael Defosseux's avatar
Raphael Defosseux committed
78

Rohan's avatar
Rohan committed
79
80
81
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
Raphael Defosseux's avatar
Raphael Defosseux committed
82
FROM registry.access.redhat.com/ubi7/ubi:latest as oai-upf-vpp
Rohan's avatar
Rohan committed
83
84
85
86
87

# We install some debug tools for the moment in addition of mandatory libraries
RUN yum repolist --disablerepo=* && \
    yum update -y && \
    yum install -y \
Raphael Defosseux's avatar
Raphael Defosseux committed
88
89
90
91
92
93
94
95
96
97
98
      net-tools \
      iputils \
      tshark \
      iproute \
      wget && \
    wget http://repo.openfusion.net/centos7-x86_64/hyperscan-devel-5.3.0-1.of.el7.x86_64.rpm \
         http://repo.openfusion.net/centos7-x86_64/hyperscan-5.3.0-1.of.el7.x86_64.rpm && \
    rpm -i *.rpm && \
    rm *.rpm && \
    yum remove -y wget && \
    rm -rf /var/lib/apt/lists/*
Rohan's avatar
Rohan committed
99

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

Rohan's avatar
Rohan committed
105
106
107
WORKDIR /openair-upf/etc
COPY --from=vpp-upg-builder /vpp-upf/scripts/upg_conf/init.conf .
COPY --from=vpp-upg-builder /vpp-upf/scripts/upg_conf/startup_debug.conf .
Rohan's avatar
Rohan committed
108
109

WORKDIR /usr/lib64
Rohan's avatar
Rohan committed
110
COPY --from=vpp-upg-builder /vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/ .
Rohan's avatar
Rohan committed
111
112
113
114
115

RUN ldconfig

RUN groupadd vpp

Rohan's avatar
Rohan committed
116
117
WORKDIR /openair-upf
COPY --from=vpp-upg-builder /vpp-upg/scripts/run.sh  .
Rohan's avatar
Rohan committed
118
119
120
121
122

#expose
EXPOSE 8085/udp 2152/udp

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