0

I try to install nginx with rtmp module and my own patch but after install the folder /erc/nginx is empty.

My Dockerfile

FROM debian:10

ARG ROOT=/tmp/build
ARG NGINXV=1.18.0
ARG FILE_PATH=/tmp/patch
ARG INSTANCE=nginx

RUN mkdir -p $FILE_PATH
COPY patch/nginx-rtmp-module-sl1.patch $FILE_PATH

RUN apt-get update && apt-get install -y \
        git \
        libpcre3 \
        libpcre3-dev \
        openssl \
        libssl-dev \
        zlib1g \
        zlib1g-dev \
        libzmq3-dev \
        wget \
        patch \
        gcc \
        make

RUN   mkdir -p $ROOT \
      && cd $ROOT \
      && rm -rf nginx-$NGINXV nginx-rtmp-module nginx-push-stream-module \
      && [ -f nginx-$NGINXV.tar.gz ] || wget https://nginx.org/download/nginx-$NGINXV.tar.gz \
      && tar xvzf nginx-$NGINXV.tar.gz \
      && git clone https://github.com/wandenberg/nginx-push-stream-module \
      && git clone https://github.com/arut/nginx-rtmp-module \
      && cd nginx-rtmp-module \
      && patch -p1 < /$FILE_PATH/nginx-rtmp-module-sl1.patch \
      && cd .. \
      && cd nginx-$NGINXV \
      && ./configure \
            --prefix=/etc/$INSTANCE \
            --sbin-path=/usr/sbin/$INSTANCE \
            --conf-path=/etc/$INSTANCE/$INSTANCE.conf \
            --error-log-path=/var/log/$INSTANCE/error.log \
            --http-log-path=/var/log/$INSTANCE/access.log \
            --pid-path=/var/run/$INSTANCE.pid \
            --lock-path=/var/run/$INSTANCE.lock \
            --http-client-body-temp-path=/var/cache/$INSTANCE/client_temp \
            --http-proxy-temp-path=/var/cache/$INSTANCE/proxy_temp \
            --http-fastcgi-temp-path=/var/cache/$INSTANCE/fastcgi_temp \
            --http-uwsgi-temp-path=/var/cache/$INSTANCE/uwsgi_temp \
            --http-scgi-temp-path=/var/cache/$INSTANCE/scgi_temp \
            --user=www-data \
            --group=www-data \
            --with-ld-opt=-lzmq \
            --add-module=../nginx-push-stream-module \
            --add-module=../nginx-rtmp-module \
            --with-http_ssl_module \
            --with-http_v2_module \
            --with-http_realip_module \
            --with-http_sub_module \
            --with-http_secure_link_module \
            --with-http_stub_status_module \
            --with-stream \
            --with-stream=dynamic \
            --with-stream_ssl_module \
            --with-stream_realip_module \
            --with-cc-opt='-Wno-error=implicit-fallthrough' \
         && make -j 8 \
         && strip objs/nginx \
         && echo `pwd`/objs/nginx

COPY start.sh /start.sh
CMD ["sh", "/start.sh"]

I thought this is because of i used volumes with docker-compose, but i got the same error if i build the container without some volumes.

I also don't know how to rebuild the container without cache. I tried to stop and rm the container but when i try rebuild it docker just uses cache

Viktor
  • 1,532
  • 6
  • 22
  • 61
  • Why not make the base image `nginx*`? I think you're doing it the hard way – Elgarni May 19 '20 at 15:22
  • Because firstly I need rtmp module which is not included in base image nginx and secondly I have my own patch for rtmp module – Viktor May 19 '20 at 15:54
  • You can use the nginx as base image, and then do your adjustment afterwards. You'll end up with less code in the dockerfile – Elgarni May 19 '20 at 20:18
  • Unfortunately, my knowledge is not enough how to union base image with those code which I wrote in the head of topic – Viktor May 20 '20 at 10:26

1 Answers1

0

The answer is the fact that i forgot executed "make install" command

Viktor
  • 1,532
  • 6
  • 22
  • 61