Write the docker file to set the instructions that need to be executed, and directly install the various dependencies and external functions required by freeswitch.
#When the system kernel is incompatible with the docker system, switch bullseye to buster FROM debian:buster MAINTAINER Andrey Volk <andrey@signalwire.com>
RUN sed -i 's/http:\/\/deb.debian.org/http:\/\/mirrors.aliyun.com/g' /etc/apt/sources.list
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq install git
#RUN git clone https://github.com/signalwire/freeswitch /usr/src/freeswitch RUN cd /usr/src/ \ && git clone https://github.com/signalwire/freeswitch.git -bv1.10 freeswitch \ && cd freeswitch \ && git config pull.rebase true RUN cd /usr/src/ RUN git clone https://github.com/signalwire/libks /usr/src/libs/libks RUN git clone https://github.com/freeswitch/sofia-sip /usr/src/libs/sofia-sip RUN git clone https://github.com/freeswitch/spandsp /usr/src/libs/spandsp RUN git clone https://github.com/signalwire/signalwire-c /usr/src/libs/signalwire-c
RUN cd /usr/src/libs/libks && cmake . -DCMAKE_INSTALL_PREFIX=/usr -DWITH_LIBBACKTRACE=1 && make install RUN cd /usr/src/libs/sofia-sip && ./bootstrap.sh && ./configure CFLAGS="-g -ggdb" --with-pic --with-glib=no --without-doxygen --disable-stun --prefix=/usr && make -j`nproc --all` && make install RUN cd /usr/src/libs/spandsp && git checkout 0d2e6ac && ./bootstrap.sh && ./configure CFLAGS="-g -ggdb" --with-pic --prefix=/usr && make -j`nproc --all` && make install RUN cd /usr/src/libs/signalwire-c && PKG_CONFIG_PATH=/usr/lib/pkgconfig cmake . -DCMAKE_INSTALL_PREFIX=/usr && make install
# Enable modules RUN sed -i 's|#formats/mod_shout|formats/mod_shout|' /usr/src/freeswitch/build/modules.conf.in
RUN cd /usr/src/freeswitch && ./bootstrap.sh -j RUN cd /usr/src/freeswitch && ./configure RUN cd /usr/src/freeswitch && make -j`nproc` && make install
RUN ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin/ RUN ln -sf /usr/local/freeswitch/bin/fs_cli /usr/bin/
# Install libfvad RUN cd /usr/src/ RUN git clone https://github.com/dpirch/libfvad.git \ && cd libfvad \ && autoreconf -i \ && ./configure \ && make \ && make install \ && ldconfig
# Cleanup the image #RUN apt-get clean
# Uncomment to cleanup even more #RUN rm -rf /usr/src/*