mirror of
https://github.com/Gradiant/5g-images.git
synced 2025-10-23 00:02:08 +00:00
124 lines
4.0 KiB
Docker
124 lines
4.0 KiB
Docker
FROM ubuntu:bionic AS enb-build
|
|
|
|
ARG version=2021.w28
|
|
|
|
ENV VERSION=$version
|
|
|
|
ARG NEEDED_GIT_PROXY
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV TZ=Europe
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
#install developers pkg/repo
|
|
RUN apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
|
#gcc needed for build_oai
|
|
build-essential \
|
|
psmisc \
|
|
git \
|
|
xxd \
|
|
#unzip is needed for protobuf
|
|
unzip
|
|
|
|
# In some network environments, GIT proxy is required
|
|
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
|
|
|
|
RUN apt-get update && apt-get install git
|
|
#create the WORKDIR
|
|
WORKDIR /oai-ran
|
|
RUN git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git .
|
|
RUN git checkout $VERSION
|
|
|
|
#run build_oai -I to get the builder image
|
|
RUN /bin/sh oaienv && \
|
|
cd cmake_targets && \
|
|
mkdir -p log && \
|
|
./build_oai -I -w USRP
|
|
|
|
|
|
#run build_oai to build the target image
|
|
RUN /bin/sh oaienv && \
|
|
cd cmake_targets && \
|
|
mkdir -p log && \
|
|
./build_oai --eNB --ninja -w USRP --verbose-ci
|
|
|
|
RUN apt-get install -y python3-pip && \
|
|
pip3 install --ignore-installed pyyaml && \
|
|
python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters.yaml
|
|
|
|
#start from scratch for target executable
|
|
FROM ubuntu:bionic as oai-enb
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV TZ=Europe
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
RUN apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
|
software-properties-common \
|
|
libsctp1 \
|
|
libnettle6 \
|
|
libblas3 \
|
|
libatlas3-base \
|
|
libconfig9 \
|
|
openssl \
|
|
net-tools \
|
|
dnsutils \
|
|
iputils-ping \
|
|
iproute2 \
|
|
iperf \
|
|
libyaml-0-2 && \
|
|
# Install UHD driver from ettus ppa
|
|
# At time of writing, it is 3.14
|
|
add-apt-repository ppa:ettusresearch/uhd --yes && \
|
|
apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
|
python \
|
|
libusb-1.0-0 \
|
|
libuhd003 \
|
|
uhd-host && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /opt/oai-enb/bin
|
|
COPY --from=enb-build /oai-ran/targets/bin/lte-softmodem.Rel15 .
|
|
COPY --from=enb-build /oai-ran/docker/scripts/enb_entrypoint.sh entrypoint.sh
|
|
|
|
WORKDIR /usr/local/lib/
|
|
COPY --from=enb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
|
|
COPY --from=enb-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 .
|
|
COPY --from=enb-build /oai-ran/targets/bin/librfsimulator.so.Rel15 .
|
|
COPY --from=enb-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 .
|
|
COPY --from=enb-build /oai-ran/targets/bin/libcoding.so .
|
|
COPY --from=enb-build /oai-ran/targets/bin/libparams_libconfig.so .
|
|
COPY --from=enb-build /oai-ran/cmake_targets/ran_build/build/libdfts.so .
|
|
COPY --from=enb-build /oai-ran/cmake_targets/ran_build/build/liboai_iqplayer.so .
|
|
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so"
|
|
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so"
|
|
RUN /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/librfsimulator.so"
|
|
|
|
COPY --from=enb-build /usr/local/lib/libprotobuf-c.so.1 .
|
|
|
|
RUN ldconfig
|
|
|
|
# Copy the relevant configuration files for eNB
|
|
WORKDIR /opt/oai-enb/etc
|
|
COPY --from=enb-build /oai-ran/docker/etc .
|
|
|
|
WORKDIR /opt/oai-enb
|
|
|
|
# 2152 --> S1U, GTP/UDP
|
|
# 36412 --> S1C, SCTP/UDP
|
|
# 36422 --> X2C, SCTP/UDP
|
|
EXPOSE 2152/udp 36412/udp 36422/udp
|
|
#EXPOSE 22100/tcp # ?
|
|
#EXPOSE 50000/udp # IF5 / ORI (control)
|
|
#EXPOSE 50001/udp # IF5 / ECPRI (data)
|
|
|
|
#This is a patch to support IP extraction from interface names and host names
|
|
COPY get_addresses.sh /opt/oai-enb/bin/get_addresses.sh
|
|
|
|
ENTRYPOINT ["/opt/oai-enb/bin/get_addresses.sh","/opt/oai-enb/bin/entrypoint.sh"]
|
|
CMD ["/opt/oai-enb/bin/lte-softmodem.Rel15", "-O", "/opt/oai-enb/etc/enb.conf"]
|
|
|