forked from OpenSIPS/opensips
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
262 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# syntax=docker/dockerfile:1.7-labs | ||
|
||
ARG BASE_IMAGE="sippylabs/rtpproxy:latest" | ||
FROM --platform=$TARGETPLATFORM $BASE_IMAGE AS build | ||
LABEL maintainer="Maksym Sobolyev <[email protected]>" | ||
|
||
USER root | ||
|
||
# Set Environment Variables | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR /src | ||
|
||
ARG COMPILER=clang-18 | ||
ARG COMPILER_OLD=clang-16 | ||
ARG TARGETPLATFORM | ||
ARG BUILD_OS=ubuntu-latest | ||
RUN --mount=type=bind,source=scripts/build,target=scripts/build \ | ||
scripts/build/get-arch-buildargs.rtp.io platformopts | ||
RUN --mount=type=bind,source=scripts/build,target=scripts/build \ | ||
env `scripts/build/get-arch-buildargs.rtp.io platformopts` \ | ||
sh -x scripts/build/install_depends.sh | ||
RUN apt-get install -y gpp python-is-python3 python3-pip | ||
RUN --mount=type=bind,source=dist/voiptests/requirements.txt,target=requirements.txt \ | ||
python -m pip install --break-system-packages -U -r requirements.txt | ||
|
||
COPY --exclude=.git --exclude=.github --exclude=docker --exclude=dist \ | ||
. . | ||
|
||
ARG KEEP_MODULES="dialog sipmsgops sl tm rr maxfwd rtp.io rtpproxy textops" | ||
ARG SKIP_MODULES="usrloc event_routing clusterer rtp_relay" | ||
RUN mkdir tmp && cd modules && mv ${KEEP_MODULES} ${SKIP_MODULES} ../tmp && \ | ||
rm -rf * && cd ../tmp && mv ${KEEP_MODULES} ${SKIP_MODULES} ../modules && \ | ||
cd .. && rmdir tmp | ||
RUN EXCLUDE_MODULES_ADD="${SKIP_MODULES}" \ | ||
env `scripts/build/get-arch-buildargs.rtp.io platformopts` \ | ||
sh -x scripts/build/do_build.sh | ||
RUN apt-get install -y libsrtp2-dev lld-18 | ||
RUN env ONE_MODULE=rtp.io LDFLAGS="-flto -fuse-ld=lld" CFLAGS=-flto \ | ||
env `scripts/build/get-arch-buildargs.rtp.io platformopts` \ | ||
sh -x scripts/build/do_build.sh | ||
ARG CC=${COMPILER} | ||
COPY --exclude=.git --exclude=.github dist/rtpproxy dist/rtpproxy | ||
RUN cd dist/rtpproxy && ./configure | ||
|
||
COPY --exclude=.git --exclude=.github dist/voiptests dist/voiptests | ||
|
||
ENV MM_TYPE=opensips | ||
ENV MM_BRANCH=master | ||
ENV MM_ROOT=../.. | ||
ENV RTPP_BRANCH=DOCKER | ||
ENV RTPPC_TYPE=rtp.io | ||
ENV RTPPROXY_DIST=../../dist/rtpproxy | ||
ENV ALICE_ARGS="-4" | ||
WORKDIR dist/voiptests | ||
ENTRYPOINT [ "sh", "-x", "./test_run.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -x | ||
|
||
fltplatforms() { | ||
case "${BASE_IMAGE}" in | ||
alpine:3.15) | ||
FILT="grep -v -e ^linux/arm/v6\$" # bus error | ||
;; | ||
ubuntu:20.04) | ||
FILT="grep -v -e ^linux/arm/v7\$" # broken cmake | ||
;; | ||
*) | ||
FILT="cat" | ||
;; | ||
esac | ||
${FILT} | ||
} | ||
|
||
platformopts() { | ||
case "${BUILD_OS}" in | ||
debian*) | ||
case "${TARGETPLATFORM}" in | ||
linux/ppc64le | linux/arm/v7) | ||
echo "COMPILER=${COMPILER_OLD}" | ||
;; | ||
esac | ||
;; | ||
esac | ||
echo "${@}" | ||
} | ||
|
||
echo "BUILD_OS=${BUILD_OS} TARGETPLATFORM=${TARGETPLATFORM}" >&2 | ||
|
||
case "${1}" in | ||
platformopts) | ||
shift | ||
platformopts "${@}" | ||
;; | ||
fltplatforms) | ||
fltplatforms | ||
;; | ||
*) | ||
echo "usage: `basename "${0}"` (platformopts|fltplatforms) [opts]" 2>&1 | ||
exit 1 | ||
;; | ||
esac |