2021-01-04 01:41:06 +00:00
|
|
|
ARG NGINX_VERSION=1.19.2
|
2020-08-22 20:25:57 +00:00
|
|
|
|
2021-01-04 01:41:06 +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 abuild-keygen -a -i
|
|
|
|
|
|
|
|
# Check out aports
|
|
|
|
RUN git config --global user.name Docker
|
|
|
|
RUN git config --global user.email "$(whoami)@localhost"
|
2021-01-04 01:41:06 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
###
|
|
|
|
|
2021-01-04 01:41:06 +00:00
|
|
|
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
|
|
|
|
COPY nginx/rootfs/ /
|
|
|
|
RUN chmod +x /usr/local/bin/*
|
2020-08-22 20:25:57 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|