fixeria submitted this change.
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
---
M open5gs-master/Dockerfile
1 file changed, 17 insertions(+), 24 deletions(-)
diff --git a/open5gs-master/Dockerfile b/open5gs-master/Dockerfile
index eec8d71..6579db4 100644
--- a/open5gs-master/Dockerfile
+++ b/open5gs-master/Dockerfile
@@ -6,31 +6,11 @@
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 && \
- apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
vim \
sudo \
+ iproute2 \
iputils-ping \
net-tools && \
apt-get clean
@@ -44,14 +24,27 @@
WORKDIR /home/${username}
-# build + install open5gs
-
+# clone open5gs
ARG GITHUB_USER=open5gs
ARG GITHUB_REPO=open5gs
ARG OPEN5GS_BRANCH=main
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
+# update the source code (if needed)
RUN cd $GITHUB_REPO && \
- git fetch && git checkout -f -B $OPEN5GS_BRANCH origin/$OPEN5GS_BRANCH && \
+ 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 && \
meson build && ninja -C build install
To view, visit change 27070. To unsubscribe, or for help writing mail filters, visit settings.