dockerfile
This commit is contained in:
commit
2a88fb858c
72
Dockerfile
Normal file
72
Dockerfile
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
FROM ubuntu
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV NODE_MAJOR=20
|
||||
|
||||
# System update and basic tools
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gnupg ca-certificates curl sudo && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# -------------------------------
|
||||
# Install MongoDB 8.0
|
||||
# -------------------------------
|
||||
RUN curl -fsSL https://pgp.mongodb.com/server-8.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg && \
|
||||
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/8.0 multiverse" \
|
||||
> /etc/apt/sources.list.d/mongodb-org-8.0.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y mongodb-org && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# -------------------------------
|
||||
# Install dependencies for open5gs
|
||||
# -------------------------------
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3-pip python3-setuptools python3-wheel \
|
||||
ninja-build build-essential flex bison git cmake \
|
||||
libsctp-dev libgnutls28-dev libgcrypt-dev libssl-dev \
|
||||
libmongoc-dev libbson-dev libyaml-dev libnghttp2-dev \
|
||||
libmicrohttpd-dev libcurl4-gnutls-dev libtins-dev \
|
||||
libtalloc-dev meson && \
|
||||
# Handle libidn conditional dependency
|
||||
(apt-cache show libidn-dev >/dev/null 2>&1 && apt-get install -y --no-install-recommends libidn-dev || apt-get install -y --no-install-recommends libidn11-dev) && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# -------------------------------
|
||||
# Build and install open5gs
|
||||
# -------------------------------
|
||||
WORKDIR /opt
|
||||
RUN git clone https://github.com/open5gs/open5gs && \
|
||||
cd open5gs && \
|
||||
meson build --prefix=$(pwd)/install && \
|
||||
ninja -C build && \
|
||||
cd build && ninja install
|
||||
|
||||
RUN cp /opt/open5gs/install/bin/open5gs* /usr/bin/
|
||||
|
||||
# -------------------------------
|
||||
# Install Node.js 20 (for WebUI)
|
||||
# -------------------------------
|
||||
RUN mkdir -p /etc/apt/keyrings && \
|
||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" \
|
||||
> /etc/apt/sources.list.d/nodesource.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y nodejs supervisor && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# -------------------------------
|
||||
# Build WebUI
|
||||
# -------------------------------
|
||||
WORKDIR /opt/open5gs/webui
|
||||
RUN npm ci
|
||||
COPY open5gs.conf /etc/supervisor/conf.d/
|
||||
|
||||
COPY open5gs-webui.conf /etc/supervisor/conf.d/
|
||||
|
||||
WORKDIR /etc/open5gs/
|
||||
|
||||
RUN cp -r /opt/open5gs/install/etc/open5gs/* /etc/open5gs
|
||||
|
||||
COPY go.sh .
|
||||
COPY stp.sh .
|
||||
Loading…
Reference in New Issue
Block a user