Created
May 14, 2019 09:20
-
-
Save vahidov/186ea02064229cab30f14ce955f2c0a2 to your computer and use it in GitHub Desktop.
Janus Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:stretch | |
ENV USRSCTP_VERSION=0.9.3.0 | |
ENV LIBSRTP_VERSION=2.2.0 | |
ARG BUILD_SRC="/usr/local/src" | |
ARG JANUS_CONFIG_DEPS="\ | |
--prefix=/opt/janus \ | |
" | |
ARG JANUS_CONFIG_OPTIONS="\ | |
--enable-post-processing \ | |
--disable-data-channels \ | |
--disable-unix-sockets \ | |
--disable-rabbitmq \ | |
--disable-mqtt \ | |
--disable-plugin-lua \ | |
" | |
ARG JANUS_BUILD_DEPS_DEV="\ | |
libcurl4-openssl-dev \ | |
libjansson-dev \ | |
libssl-dev \ | |
libsofia-sip-ua-dev \ | |
libglib2.0-dev \ | |
libopus-dev \ | |
libogg-dev \ | |
pkg-config \ | |
libmicrohttpd-dev \ | |
libconfig-dev \ | |
gtk-doc-tools \ | |
" | |
ARG JANUS_BUILD_DEPS_EXT="\ | |
libavutil-dev \ | |
libavcodec-dev \ | |
libavformat-dev \ | |
gengetopt \ | |
libtool \ | |
automake \ | |
git-core \ | |
build-essential \ | |
cmake \ | |
autoconf \ | |
curl \ | |
" | |
RUN \ | |
# init build env & install apt deps | |
export JANUS_BUILD_DEPS_DEV="${JANUS_BUILD_DEPS_DEV}" && export JANUS_CONFIG_OPTIONS="${JANUS_CONFIG_OPTIONS}"\ | |
&& /usr/sbin/groupadd -r janus && /usr/sbin/useradd -r -g janus janus \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get update \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get -y upgrade \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install $JANUS_BUILD_DEPS_DEV ${JANUS_BUILD_DEPS_EXT} ca-certificates gdb \ | |
# build libnice | |
&& git clone https://gitlab.freedesktop.org/libnice/libnice --depth 1 ${BUILD_SRC}/libnice \ | |
&& cd ${BUILD_SRC}/libnice \ | |
&& ./autogen.sh \ | |
&& ./configure --prefix=/usr \ | |
&& make \ | |
&& make install \ | |
# build usrsctp | |
&& git clone https://github.com/sctplab/usrsctp --depth 1 -b ${USRSCTP_VERSION} ${BUILD_SRC}/usrsctp \ | |
&& cd ${BUILD_SRC}/usrsctp \ | |
&& ./bootstrap \ | |
&& ./configure --prefix=/usr \ | |
&& make \ | |
&& make install \ | |
# build libwebsockets | |
&& git clone https://github.com/warmcat/libwebsockets.git ${BUILD_SRC}/libwebsockets \ | |
&& cd ${BUILD_SRC}/libwebsockets \ | |
# && git checkout bd9c1b715f2e2ab580e291143d767a389e775ac1 \ | |
&& mkdir ${BUILD_SRC}/libwebsockets/build \ | |
&& cd ${BUILD_SRC}/libwebsockets/build \ | |
&& cmake -DLWS_MAX_SMP=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" .. \ | |
&& make \ | |
&& make install \ | |
# build libsrtp | |
&& git clone https://github.com/cisco/libsrtp.git --depth 1 -b v${LIBSRTP_VERSION} ${BUILD_SRC}/libsrtp \ | |
&& cd ${BUILD_SRC}/libsrtp \ | |
&& ./configure --prefix=/usr --enable-openssl \ | |
&& make shared_library \ | |
&& make install \ | |
# build janus | |
&& git clone https://github.com/meetecho/janus-gateway.git --depth 1 ${BUILD_SRC}/janus-gateway \ | |
&& cd ${BUILD_SRC}/janus-gateway \ | |
&& ./autogen.sh \ | |
&& ./configure CFLAGS="-O0 -g -ggdb" ${JANUS_CONFIG_DEPS} $JANUS_CONFIG_OPTIONS \ | |
&& make \ | |
&& make install \ | |
&& chown -R janus:janus /opt/janus \ | |
# build cleanup | |
&& cd ${BUILD_SRC} \ | |
&& rm -rf \ | |
libsrtp \ | |
janus-gateway \ | |
usrsctp \ | |
libwebsockets \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get -y --auto-remove purge ${JANUS_BUILD_DEPS_EXT} \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get -y clean \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get -y autoclean \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get -y autoremove \ | |
&& rm -rf /usr/share/locale/* \ | |
&& rm -rf /var/cache/debconf/*-old \ | |
&& rm -rf /usr/share/doc/* \ | |
&& rm -rf /var/lib/apt/* | |
RUN rm -r /opt/janus/etc/janus/ | |
COPY janus/conf /opt/janus/etc/janus/ | |
COPY janus/janusStarter.sh /opt/janus/bin/janusStarter.sh | |
RUN chown janus.janus -R /opt/janus/etc/ | |
ENTRYPOINT ["/opt/janus/bin/janusStarter.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment