-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.ci
More file actions
84 lines (66 loc) · 2.54 KB
/
Dockerfile.ci
File metadata and controls
84 lines (66 loc) · 2.54 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# syntax=docker/dockerfile:1.7
############################
# Stage 1: Build dependencies + FreeSWITCH
############################
FROM debian:12 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates git curl wget \
build-essential cmake automake autoconf libtool libtool-bin libltdl-dev pkg-config \
libssl-dev zlib1g-dev libdb-dev unixodbc-dev libncurses5-dev libexpat1-dev \
libgdbm-dev bison erlang-dev libtpl-dev libtiff5-dev uuid-dev \
libpcre3-dev libpcre2-dev libedit-dev libsqlite3-dev libcurl4-openssl-dev nasm \
libogg-dev libspeex-dev libspeexdsp-dev libldns-dev python3-dev \
libavformat-dev libswscale-dev libswresample-dev \
liblua5.2-dev libopus-dev libpq-dev \
libsndfile1-dev libflac-dev libvorbis-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
RUN git clone https://github.com/signalwire/libks && \
git clone https://github.com/freeswitch/sofia-sip && \
git clone https://github.com/freeswitch/spandsp && \
git clone https://github.com/signalwire/signalwire-c && \
git clone https://github.com/signalwire/freeswitch
# libks
WORKDIR /src/libks
RUN cmake . -DCMAKE_INSTALL_PREFIX=/usr -DWITH_LIBBACKTRACE=1 && \
make -j"$(nproc)" && make install
# sofia-sip
WORKDIR /src/sofia-sip
RUN ./bootstrap.sh && \
./configure --with-pic --with-glib=no --without-doxygen --disable-stun --prefix=/usr && \
make -j"$(nproc)" && make install
# spandsp
WORKDIR /src/spandsp
RUN ./bootstrap.sh && \
./configure --with-pic --prefix=/usr && \
make -j"$(nproc)" && make install
# signalwire-c
WORKDIR /src/signalwire-c
RUN PKG_CONFIG_PATH=/usr/lib/pkgconfig cmake . -DCMAKE_INSTALL_PREFIX=/usr && \
make -j"$(nproc)" && make install
# FreeSWITCH SDK
WORKDIR /src/freeswitch
RUN ./bootstrap.sh -j && \
./configure --prefix=/usr && \
make -j"$(nproc)" && make install
############################
# Stage 2: Slim SDK image (no FreeSWITCH runtime)
############################
FROM debian:12
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
build-essential \
clang clang-format clang-tidy clang-tools \
cppcheck cmake pkg-config ccache \
libssl-dev zlib1g-dev \
libspeexdsp-dev libspandsp-dev \
git curl wget \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy only SDK bits
COPY --from=builder /usr/include/freeswitch/ /usr/include/freeswitch/
COPY --from=builder /usr/lib/pkgconfig/freeswitch.pc /usr/lib/pkgconfig/
COPY --from=builder /usr/lib/libfreeswitch.so* /usr/lib/
WORKDIR /work