Skip to content

Commit

Permalink
Add alpine Dockerfile
Browse files Browse the repository at this point in the history
Builds *much* faster, and image size is 120M, while debian is 300M.
  • Loading branch information
orgads committed Jun 22, 2023
1 parent 85fd27f commit d6e2d56
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
64 changes: 64 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
FROM alpine:3.18 AS build

RUN apk add --no-cache \
ca-certificates \
curl-dev \
ffmpeg-dev \
g++ \
gcc \
git \
gperf \
glib-dev \
hiredis-dev \
iptables-dev \
json-glib-dev \
libevent-dev \
libpcap-dev \
libwebsockets-dev \
make \
mariadb-connector-c-dev \
markdown \
openssl-dev \
opus-dev \
pandoc \
pcre-dev \
spandsp-dev \
xmlrpc-c-dev

WORKDIR /usr/src
RUN git clone https://github.com/sipwise/rtpengine
RUN sed -i 's:/bin/bash:/bin/sh:' rtpengine/utils/build_test_wrapper
WORKDIR /usr/src/rtpengine/daemon
RUN make -j$(nproc) install

FROM alpine:3.18

VOLUME ["/tmp"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["rtpengine"]

EXPOSE 23000-32768/udp 22222/udp

RUN apk add --no-cache \
bash \
ca-certificates \
curl \
ffmpeg-libavcodec \
ffmpeg-libavformat \
glib \
hiredis \
iptables \
json-glib \
libevent \
libpcap \
libwebsockets \
mariadb-connector-c \
openssl \
opus \
pcre \
spandsp \
xmlrpc-c-client

COPY --from=build /usr/src/rtpengine/daemon/rtpengine /usr/local/bin/rtpengine
COPY ./entrypoint.sh /entrypoint.sh
COPY ./rtpengine.conf /etc
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
#!/bin/sh

set -e

PATH=/usr/local/bin:$PATH
Expand Down

0 comments on commit d6e2d56

Please sign in to comment.