michaelkamprath / multi-service-rtmp-broadcaster

A dockerized livestream rebroadcaster
GNU General Public License v3.0
136 stars 25 forks source link

Can't create docker image #31

Closed Paolo97Gll closed 3 years ago

Paolo97Gll commented 3 years ago

Hello, I have a problem when I try to create the docker image following the instructions on the README.md file.

First I clone the repository, then I cd into and and use the following command:

docker build -t multistreaming-server-git ./multistreaming-server/

After a while, during the creation of the image, i receive the following error:

+ pip3 install 'supervisor==4.2.1' 'pipenv==2020.8.13'
/bin/sh: pip3: not found
The command '/bin/sh -c set -x  && addgroup -S stunnel  && adduser -S -D -H -h /dev/null -s /sbin/nologin -G stunnel -g stunnel stunnel  && echo "http://dl-3.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories  && apk update  && apk add --no-cache --update stunnel ca-certificates  && apk add --no-cache pcre openssl stunnel gettext python3  && apk add --no-cache --virtual build-deps build-base pcre-dev openssl-dev zlib zlib-dev wget make  && wget -O nginx-${NGINX_VERSION}.tar.gz http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz  && tar -zxvf nginx-${NGINX_VERSION}.tar.gz  && wget -O nginx-rtmp-module-${RTMP_MODULE_VERSION}.tar.gz https://github.com/${RTMP_REPO}/nginx-rtmp-module/archive/${RTMP_MODULE_VERSION}.tar.gz  && tar -zxvf nginx-rtmp-module-${RTMP_MODULE_VERSION}.tar.gz  && cd nginx-${NGINX_VERSION}  && export CFLAGS=-Wno-error  && ./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-${RTMP_MODULE_VERSION}  && make  && make install  && cp /nginx-rtmp-module-${RTMP_MODULE_VERSION}/stat.xsl /usr/local/nginx/html/  && apk del build-deps  && mkdir -p /var/www/html/recordings  && mkdir -p /var/run/stunnel/  && chown nobody:nobody -R /var/www/html  && chown stunnel:stunnel /var/run/stunnel/  && wget -O /tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static  && chmod +x /tini  && pip3 install supervisor==${SUPERVISORD_VERSION} pipenv==${PIPENV_PACKAGE_VERSION}' returned a non-zero code: 127

immagine

The error seems to appear when executing the line 36 in the Dockerfile. It's strange, because it can't find pip3 in the image.

Thank you for the help!

michaelkamprath commented 3 years ago

Huh ... that is strange as it is building fine on docker hub. That pip3 requirement should have been taken care of with the python3 install that occurs just prior to it ... though things could have changed in terms of what gets installed. I just checked however, and it builds fine for me (I know, the classic IT response). May I ask what is your environment (OS, version, docker version, etc) that you are trying to build with? Also, the screen show you shared above looks like for what ever reason a number of the steps were skipped and that you build seems to be linked with something else (I am not sure that the "purging libidn2" line is about. Did you alter the Dockerfile somehow? Finally, the command you list:

docker build -t multistreaming-server-git ./multistreaming-server/

Is not the command listed in the README. The subtle difference is a change in the tag name. I know, should be an issue, but it does make me wonder if there is anything else that is different, hence my questions above.

Paolo97Gll commented 3 years ago

The OS is Ubuntu 20.04.1 LTS (kernel 5.4.0-58-generic) running on a Proxmox virtualization environment; Docker version 19.03.8, build afacb8b7f0. It is a VM that I use to make tests, and I run many containers without problems.

You're right, the command I reported above is slightly different from the one in the README. My fault, I made some tests to try fixing the problem and the screen I showed you is from the last test I made.

Today I've run some other tests in a clean environment (I stopped every running container and cleaned all the docker environment with docker system prune -a). After cloning the repo (without changing anything, only cloning), I issued:

docker build -t multistreaming-server ./multistreaming-server/

but I've encountered the same error:

immagine immagine

I post here the Dockerfile to be sure, but it's the same in your repo:

FROM jrottenberg/ffmpeg:4.2-alpine
MAINTAINER Michael Kamprath "https://github.com/michaelkamprath"

ARG NGINX_VERSION=1.19.2
ARG RTMP_REPO=uizaio
ARG RTMP_MODULE_VERSION=1.4.0.4
ARG TINI_VERSION=v0.19.0
ARG SUPERVISORD_VERSION=4.2.1
ARG PIPENV_PACKAGE_VERSION=2020.8.13

RUN set -x \
 && addgroup -S stunnel \
 && adduser -S -D -H -h /dev/null -s /sbin/nologin -G stunnel -g stunnel stunnel \
 && echo "http://dl-3.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories \
 && apk update \
 && apk add --no-cache --update stunnel ca-certificates \
 && apk add --no-cache pcre openssl stunnel gettext python3 \
 && apk add --no-cache --virtual build-deps build-base pcre-dev openssl-dev zlib zlib-dev wget make \
 && wget -O nginx-${NGINX_VERSION}.tar.gz http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz \
 && tar -zxvf nginx-${NGINX_VERSION}.tar.gz \
 && wget -O nginx-rtmp-module-${RTMP_MODULE_VERSION}.tar.gz https://github.com/${RTMP_REPO}/nginx-rtmp-module/archive/${RTMP_MODULE_VERSION}.tar.gz \
 && tar -zxvf nginx-rtmp-module-${RTMP_MODULE_VERSION}.tar.gz \
 && cd nginx-${NGINX_VERSION} \
 && export CFLAGS=-Wno-error \
 && ./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-${RTMP_MODULE_VERSION} \
 && make \
 && make install \
 && cp /nginx-rtmp-module-${RTMP_MODULE_VERSION}/stat.xsl /usr/local/nginx/html/ \
 && apk del build-deps \
 && mkdir -p /var/www/html/recordings \
 && mkdir -p /var/run/stunnel/ \
 && chown nobody:nobody -R /var/www/html \
 && chown stunnel:stunnel /var/run/stunnel/ \
 && wget -O /tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static \
 && chmod +x /tini \
 && pip3 install supervisor==${SUPERVISORD_VERSION} pipenv==${PIPENV_PACKAGE_VERSION}

COPY Pipfile Pipfile.lock /
RUN  pipenv install --system --deploy

COPY supervisord.conf /etc/supervisor/supervisord.conf
COPY stunnel-conf/etc-default-stunnel /etc/default/stunnel
COPY stunnel-conf/etc-stunnel-conf.d-fb.conf /etc/stunnel/conf.d/fb.conf
COPY stunnel-conf/etc-stunnel-conf.d-ig.conf /etc/stunnel/conf.d/ig.conf
COPY stunnel-conf/etc-stunnel-stunnel.conf /etc/stunnel/stunnel.conf

COPY index.html /usr/local/nginx/html/
COPY nginx-conf/nginx.conf /base-nginx.conf
COPY launch-nginx-server.sh launch-nginx-server.sh
COPY rtmp-conf-generator.py nginx-template.conf.j2 /

EXPOSE 1935
EXPOSE 80

STOPSIGNAL SIGTERM
ENTRYPOINT ["/tini", "--"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

I also tried changing pip3 with python3 -m pip in this line, but it didn't solve the problem (/usr/bin/python3: No module named pip). It seems that pip3 doesnt exist.

michaelkamprath commented 3 years ago

Somehow you are not getting the standard installation package in the the apk add commands. This might happen if you are in an environment where calls out ot he alpine package management server are being intercepted for "security" reasons, but the replacement server is not correctly set up. Are you in a corporate environment when trying this out? They might be blocking the install of pip3 because they having set up their PyPi server. Can you install python on your ubuntu install and use pip or pip3?

michaelkamprath commented 3 years ago

By the way, if you can't build it yourself, you can always just pull the pre-built version of the image from Docker hub.

docker pull kamprath/multistreaming-server

Then, of course, when you launch the image, you refer to it by kamprath/multistreaming-server rather than just multistreaming-server.

Paolo97Gll commented 3 years ago

I'm not in a corporative environment, and yes, I can install and use pip and pip3 on my ubuntu host without any problem. For now, I ended up pulling the image you posted: I tested it this morning and it does a great job!

But still, it's a really weird thing! Thanks for the help

michaelkamprath commented 3 years ago

I agree, your situation is weird, and technically put, "non-standard behavior".

michaelkamprath commented 3 years ago

Given that you can pull the prebuilt docker images, I am going to close this issue. Please reopen if you have further problems with Docker. Also, if you ever figure out what you are getting non-standard behavior with your apk installs, would love to know.