-
Notifications
You must be signed in to change notification settings - Fork 239
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (39 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
48 lines (39 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Build stage
FROM alpine:3.22 AS builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG RELEASE_VERSION
# Install build dependencies
RUN apk add --no-cache \
autoconf \
automake \
pkgconfig \
make \
gcc \
musl-dev \
linux-headers
# Copy source code
WORKDIR /workdir
COPY . .
# Build natively on target platform (using QEMU when cross-building)
RUN echo "Building for $TARGETPLATFORM" && \
echo "RELEASE_VERSION=$RELEASE_VERSION" && \
RELEASE_VERSION=${RELEASE_VERSION} autoreconf -fi && \
./configure --enable-optimization=-O3 && \
make
# Runtime stage
FROM alpine:3.22
# Copy the built binary and config
COPY --from=builder /workdir/src/rtp2httpd /usr/local/bin/
COPY --from=builder /workdir/rtp2httpd.conf /usr/local/etc/
# Expose the default port
EXPOSE 5140
# Recommended options:
# --cap-add=NET_ADMIN: Allow setting larger UDP receive buffers (bypassing rmem_max via SO_RCVBUFFORCE)
# --ulimit memlock=-1:-1: Required for zero-copy (MSG_ZEROCOPY needs locked memory pages)
#
# Usage:
# docker run --network=host --cap-add=NET_ADMIN --ulimit memlock=-1:-1 --rm \
# ghcr.io/stackia/rtp2httpd:latest
# Run the application
ENTRYPOINT ["/usr/local/bin/rtp2httpd"]