Created
June 15, 2018 09:08
-
-
Save vahidov/b6c585f215a67a41ec2219a055d9ea7a 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 LIBWEBSOCKETS_VERSION=2.4.2 | |
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 \ | |
libnice-dev \ | |
libssl-dev \ | |
libsofia-sip-ua-dev \ | |
libglib2.0-dev \ | |
libopus-dev \ | |
libogg-dev \ | |
pkg-config \ | |
libmicrohttpd-dev \ | |
libsrtp-dev \ | |
" | |
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 usrsctp | |
&& git clone https://github.com/sctplab/usrsctp -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 -b v${LIBWEBSOCKETS_VERSION} ${BUILD_SRC}/libwebsockets \ | |
&& mkdir ${BUILD_SRC}/libwebsockets/build \ | |
&& cd ${BUILD_SRC}/libwebsockets/build \ | |
&& cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" .. \ | |
&& make \ | |
&& make install \ | |
# build libsrtp | |
&& git clone https://github.com/cisco/libsrtp.git -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 ${BUILD_SRC}/janus-gateway \ | |
&& cd ${BUILD_SRC}/janus-gateway \ | |
&& ./autogen.sh \ | |
&& ./configure ${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/ | |
USER janus | |
COPY janus/conf /opt/janus/etc/janus/ | |
COPY ssl /opt/janus/share/janus/certs/ | |
ENTRYPOINT ["/opt/janus/bin/janus"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment