Open Ya5e opened 4 years ago
I found a solution that works enabling you to build the RTMP module with current OS versions. This isnt ideal, and is not exactly clean. But it works.
Suppress error messages using CLFAGS. Within the Dockerfile add CFLAGS to your make command.
RUN cd /tmp/build/nginx-${NGINX_VERSION} && \
./configure \
--sbin-path=/usr/local/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--http-client-body-temp-path=/tmp/nginx-client-body \
--with-http_ssl_module \
--with-threads \
--add-module=/tmp/build/nginx-rtmp-module-${NGINX_RTMP_MODULE_VERSION} && \
make CFLAGS=-Wno-error -j $(getconf _NPROCESSORS_ONLN) && \
make install
CFLAGS=-Wno-error
Thanks @Ya5e, helped me.
You can also apply the patch from #1340
# Download and decompress RTMP module
RUN mkdir -p /tmp/build/nginx-rtmp-module && \
cd /tmp/build/nginx-rtmp-module && \
wget -O nginx-rtmp-module-${NGINX_RTMP_MODULE_VERSION}.tar.gz https://github.com/arut/nginx-rtmp-module/archive/v${NGINX_RTMP_MODULE_VERSION}.tar.gz && \
tar -zxf nginx-rtmp-module-${NGINX_RTMP_MODULE_VERSION}.tar.gz && \
cd nginx-rtmp-module-${NGINX_RTMP_MODULE_VERSION}
# Patch RTMP module to compile with GCC 8
RUN sed -i '169i /* fall through */' /tmp/build/nginx-rtmp-module/nginx-rtmp-module-${NGINX_RTMP_MODULE_VERSION}/ngx_rtmp_eval.c
I am unable to get this to build on Alpine versions above 3.8. I have also tested Debian buster with similar result; but would like to focus on Alpine.
It seems like a dependency might be missing; but I've checked and believe I have all the correct dependencies. At least, its consistent with other builds.
Note: Adding linux-headers did not make a difference; build still fails.
Does anyone know why RTMP would fail to build on newer versions of both Alpine and Debian?
Tested
Tested
All Nginx builds work if using Apline 3.8
The build always fails on the RTMP module.