diff --git a/Dockerfile b/Dockerfile index 6fd833c..63f3ed3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,13 @@ ## ## Build rtpengine from source ## -FROM debian:bookworm AS builder +FROM debian:bookworm-slim AS builder WORKDIR /build ARG TAG_NAME=master -ENV DEBIAN_FRONTEND noninteractive +ARG TARGETARCH +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get -y install build-essential git curl \ && echo 'man-db man-db/auto-update boolean false' | debconf-set-selections \ @@ -14,18 +15,23 @@ RUN apt-get update && apt-get -y install build-essential git curl \ && cd rtpengine \ && git checkout ${TAG_NAME} \ && apt-get -y build-dep -Ppkg.ngcp-rtpengine.nobcg729 . \ - && dpkg-buildpackage -Ppkg.ngcp-rtpengine.nobcg729 \ - && curl -qL -o /usr/bin/netdiscover https://github.com/CyCoreSystems/netdiscover/releases/download/v1.2.5/netdiscover.linux.amd64 \ + && dpkg-buildpackage -Ppkg.ngcp-rtpengine.nobcg729 -j1 \ + && case ${TARGETARCH} in \ + amd64) ARCH_SUFFIX="linux_amd64" ;; \ + arm64) ARCH_SUFFIX="linux_arm64" ;; \ + *) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \ + esac \ + && curl -qL -o /usr/bin/netdiscover https://github.com/2bleere/netdiscover/releases/download/latest/netdiscover_${ARCH_SUFFIX} \ && chmod +x /usr/bin/netdiscover ## ## Runner ## -FROM debian:bookworm +FROM debian:bookworm-slim WORKDIR /opt/rtpengine -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive RUN groupadd -r rtpengine && useradd -r -g rtpengine rtpengine