diff --git a/.github/workflows/rtp.io.yml b/.github/workflows/rtp.io.yml index 094b258c8c..b8a6db465a 100644 --- a/.github/workflows/rtp.io.yml +++ b/.github/workflows/rtp.io.yml @@ -98,3 +98,52 @@ jobs: python -m pip install -r requirements.txt DEBIAN_FRONTEND=noninteractive apt-get install -y gpp sh -x ./test_run.sh + + build_test_rtp_io_dock: + runs-on: ubuntu-latest + env: + BASE_IMAGE: ghcr.io/sippy/rtpproxy:latest + COMPILER: clang-18 + BUILD_OS: ubuntu-latest + PYTHON_VERSION: 3.12 + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout VoIPTests repo + uses: actions/checkout@v4 + with: + repository: 'sippy/voiptests' + path: dist/voiptests + + - name: Checkout RTPProxy repo + uses: actions/checkout@v4 + with: + repository: 'sippy/rtpproxy' + path: dist/rtpproxy + + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Set dynamic environment + run: | + PLATFORMS="`docker manifest inspect ${{ env.BASE_IMAGE }} | \ + jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \ + sort -u | grep -v unknown | paste -sd ','`" + echo "Platforms: ${PLATFORMS}" + echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV + + - name: Build Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./docker/Dockerfile.rtp.io + build-args: | + BASE_IMAGE=${{ env.BASE_IMAGE }} + platforms: ${{ env.PLATFORMS }} diff --git a/docker/Dockerfile.rtp.io b/docker/Dockerfile.rtp.io new file mode 100644 index 0000000000..144bfd338d --- /dev/null +++ b/docker/Dockerfile.rtp.io @@ -0,0 +1,29 @@ +# syntax=docker/dockerfile:1.7-labs + +ARG BASE_IMAGE="sippylabs/rtpproxy:latest" +FROM --platform=$TARGETPLATFORM $BASE_IMAGE AS build +LABEL maintainer="Maksym Sobolyev " + +USER root + +# Set Environment Variables +ENV DEBIAN_FRONTEND=noninteractive + +WORKDIR /tmp + +ARG COMPILER=clang-18 +ARG BUILD_OS=ubuntu-latest +RUN --mount=type=bind,source=scripts/build,target=scripts/build \ + sh -x scripts/build/install_depends.sh + +COPY --exclude=.git --exclude=.github . . + +RUN pwd +RUN ls -l + +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}" sh -x scripts/build/do_build.sh