gdq-archive/streamserver/Dockerfile

68 lines
2.2 KiB
Docker
Raw Normal View History

2021-07-09 09:07:32 +00:00
ARG NGINX_VERSION=1.20.1
FROM icedream/nginx as icedream-nginx
2020-08-22 20:25:57 +00:00
FROM nginx:${NGINX_VERSION}-alpine 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 fdk-aac-dev
2020-08-22 20:25:57 +00:00
# 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 yes "" | abuild-keygen -a -i
2020-08-22 20:25:57 +00:00
# Check out aports
RUN git config --global user.name Docker
RUN git config --global user.email "$(whoami)@localhost"
RUN git clone --depth=1 -b 3.12-stable git://git.alpinelinux.org/aports
2020-08-22 20:25:57 +00:00
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 nginx:${NGINX_VERSION}-alpine
RUN \
export DEBIAN_FRONTEND=noninteractive &&\
if command -v apk >/dev/null 2>/dev/null; then apk add --no-cache gnupg; else apt-get update && apt-get install -y gnupg wget ca-certificates && apt-get clean; fi
2021-07-09 09:07:32 +00:00
COPY --from=icedream-nginx /usr/local/bin/docker-* /usr/local/bin/
2020-08-22 20:25:57 +00:00
COPY --from=module-source /usr/src/ /usr/src/nginx-modules/
2021-07-09 09:07:32 +00:00
COPY --from=ffmpeg-build /usr/src/packages/ /packages/
COPY --from=ffmpeg-build /etc/apk/keys/ /etc/apk/keys/
2020-08-22 20:25:57 +00:00
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