-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile-ue
More file actions
101 lines (84 loc) · 2.74 KB
/
Copy pathDockerfile-ue
File metadata and controls
101 lines (84 loc) · 2.74 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Build args
################
# OS_VERSION Ubuntu OS version
# SRSRAN_REF Git ref to build
# MARCH gcc/clang compatible arch
ARG OS_VERSION=22.04
ARG SRSRAN_REF=release_23_11
ARG MARCH=x86-64-v2
##################
# Stage 1: Build #
##################
FROM ubuntu:$OS_VERSION AS builder
# Install dependencies
# We need uhd so enb and ue are built
# Use curl and unzip to get a specific ref state from GitHub
# Also install ping to test connections
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
build-essential \
cmake \
libuhd-dev \
uhd-host \
curl \
unzip \
libboost-system-dev \
libboost-program-options-dev \
libfftw3-dev \
libmbedtls-dev \
libconfig++-dev \
libsctp-dev \
libzmq3-dev && \
rm -rf /var/lib/apt/lists/*
ARG SRSRAN_REF
RUN git clone --depth 1 --branch ${SRSRAN_REF} https://github.com/srsran/srsRAN_4G.git /src
WORKDIR /src/build
ARG MARCH
RUN cmake -DCMAKE_C_FLAGS="-march=${MARCH}" -DCMAKE_CXX_FLAGS="-march=${MARCH}" ../
RUN make -j"$(nproc)"
RUN make install
# ################
# # Stage 2: Run #
# ################
FROM ubuntu:$OS_VERSION AS ue
# Build arguments for dynamic labels
ARG VERSION=dev
ARG VCS_URL=unknown
ARG VCS_REF=unknown
ARG BUILD_DATE=unknown
ARG SRSRAN_REF
ARG UPSTREAM_COMMIT=unknown
LABEL org.opencontainers.image.source="${VCS_URL}" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.url="${VCS_URL}" \
org.opencontainers.image.title="srsran-ue" \
org.opencontainers.image.description="srsRAN 4G UE Simulator" \
org.opencontainers.image.authors="Aether SD-Core <dev@lists.aetherproject.org>" \
org.opencontainers.image.vendor="Aether Project" \
org.opencontainers.image.licenses="AGPL-3.0-or-later" \
org.opencontainers.image.documentation="https://docs.srsran.com/projects/4g" \
org.srsran.upstream.source="https://github.com/srsran/srsRAN_4G.git" \
org.srsran.upstream.ref="${SRSRAN_REF}" \
org.srsran.upstream.commit="${UPSTREAM_COMMIT}"
COPY --from=builder /usr/local /usr/local
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
iputils-ping \
iproute2 \
iptables \
iperf3 \
libboost-program-options1.74.0 \
libfftw3-3 \
libmbedtls14 \
libzmq3-dev && \
rm -rf /var/lib/apt/lists/*
# Update dynamic linker
RUN ldconfig
WORKDIR /opt
COPY srsue/startup.sh startup.sh
# Run commands with line buffered standard output
# (-> get log messages in real time)
CMD ["/bin/bash","-c","./startup.sh"]