gdq-archive/streamserver/Dockerfile

60 lines
1.9 KiB
Docker
Raw Normal View History

2020-08-22 20:25:57 +00:00
FROM icedream/nginx AS ffmpeg-build
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk update
RUN apk add sudo alpine-sdk git fdk-aac@testing fdk-aac-dev@testing
# Prepare abuild
WORKDIR /usr/src
RUN chown 999:0 /usr/src
RUN adduser -h /usr/src -S -u 999 apk
RUN addgroup apk abuild
RUN echo "apk ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER apk
RUN abuild-keygen -a -i
# Check out aports
RUN git config --global user.name Docker
RUN git config --global user.email "$(whoami)@localhost"
RUN git clone --depth=1 -b $(. /etc/os-release && echo "$VERSION_ID" | grep -o '^[0-9]\+.[0-9]\+')-stable https://gitlab.alpinelinux.org/alpine/aports.git
WORKDIR /usr/src/aports
# Apply package changes
COPY patches/aports /patches/
RUN git am /patches/*.patch
WORKDIR /usr/src/aports/community/ffmpeg-serverkomplex
#RUN sed -i 's,^license=.\+$,license="non-free",g' APKBUILD
RUN sed -i 's,!check,!check !checkroot,g' APKBUILD
#RUN apkgrel -a .
RUN abuild -r
###
FROM alpine AS module-source
RUN apk add --no-cache git
RUN git config --global user.name Docker
RUN git config --global user.email "$(whoami)@localhost"
WORKDIR /usr/src
RUN git clone --depth=1 --recursive https://github.com/kaltura/nginx-vod-module.git
###
FROM icedream/nginx
COPY --from=module-source /usr/src/ /usr/src/nginx-modules/
COPY --from=0 /usr/src/packages/ /packages/
COPY --from=0 /etc/apk/keys/ /etc/apk/keys/
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN sed -i '1s#^#/packages/community\n#' /etc/apk/repositories
RUN cat /etc/apk/repositories
RUN apk update
RUN apk add ffmpeg-serverkomplex ffmpeg-serverkomplex-dev openssl openssl-dev fdk-aac
RUN \
docker-nginx-download-source &&\
docker-nginx-build \
--add-dynamic-module=../nginx-modules/nginx-vod-module --with-file-aio &&\
rm -rf /packages
RUN sed -i '1s#^#load_module modules/ngx_http_vod_module.so;\n#' /etc/nginx/nginx.conf