open5gs-master: install dependencies using apt-get build-dep

This is a 3-rd party project, which may introduce new dependencies
in the future.  Rather than maintaining our own list of packages
to install, let's employ 'apt-get build-dep'.  This tool parses
'debian/control' and installs all dependencies automatically.

Change-Id: I71ad7256116ee30f15aff38fd38588aa2bfab456
Related: SYS#5602
This commit is contained in:
Vadim Yanitskiy 2022-02-04 18:38:28 +06:00
parent f532d78922
commit e8c1360b92
1 changed files with 17 additions and 24 deletions

View File

@ -4,33 +4,13 @@ FROM $USER/debian-bullseye-build
MAINTAINER Harald Welte <laforge@gnumonks.org> MAINTAINER Harald Welte <laforge@gnumonks.org>
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
meson \
ninja-build \
libsctp-dev \
libgnutls28-dev \
libgcrypt-dev \
libssl-dev \
libidn11-dev \
libmongoc-dev \
libbson-dev \
libyaml-dev \
libnghttp2-dev \
libmicrohttpd-dev \
libcurl4-gnutls-dev \
iproute2 \
ca-certificates \
netbase && \
apt-get clean
RUN apt-get update && \ RUN apt-get update && \
apt-get upgrade -y && \ apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive \ DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
vim \ vim \
sudo \ sudo \
iproute2 \
iputils-ping \ iputils-ping \
net-tools && \ net-tools && \
apt-get clean apt-get clean
@ -44,14 +24,27 @@ RUN useradd -m --uid=1000 ${username} && \
WORKDIR /home/${username} WORKDIR /home/${username}
# build + install open5gs # clone open5gs
ARG GITHUB_USER=open5gs ARG GITHUB_USER=open5gs
ARG GITHUB_REPO=open5gs ARG GITHUB_REPO=open5gs
ARG OPEN5GS_BRANCH=main ARG OPEN5GS_BRANCH=main
RUN git clone https://github.com/$GITHUB_USER/$GITHUB_REPO RUN git clone https://github.com/$GITHUB_USER/$GITHUB_REPO
# install dependencies specified in debian/control (cache them)
RUN cd $GITHUB_REPO && \
git checkout $OPEN5GS_BRANCH && \
apt-get build-dep -y .
ADD https://api.github.com/repos/$GITHUB_USER/$GITHUB_REPO/git/refs/heads/$OPEN5GS_BRANCH /root/open5gs-ver.json ADD https://api.github.com/repos/$GITHUB_USER/$GITHUB_REPO/git/refs/heads/$OPEN5GS_BRANCH /root/open5gs-ver.json
# update the source code (if needed)
RUN cd $GITHUB_REPO && \
git fetch && git checkout -f -B $OPEN5GS_BRANCH origin/$OPEN5GS_BRANCH
# update installed dependencies, install missing (if any)
RUN cd $GITHUB_REPO && \
apt-get build-dep -y .
# build + install open5gs
RUN cd $GITHUB_REPO && \ RUN cd $GITHUB_REPO && \
git fetch && git checkout -f -B $OPEN5GS_BRANCH origin/$OPEN5GS_BRANCH && \
meson build && ninja -C build install meson build && ninja -C build install