update dockerfile

This commit is contained in:
Alf 2018-09-30 02:03:54 -07:00
parent 9bbc25b11a
commit 64dcb9f0ae
1 changed files with 12 additions and 7 deletions

View File

@ -1,16 +1,16 @@
ARG NGINX_VERSION=1.14.0 ARG NGINX_VERSION=1.14.0
ARG NGINX_RTMP_VERSION=1.2.1 ARG NGINX_RTMP_VERSION=1.2.1
ARG FFMPEG_VERSION=3.4.2 ARG FFMPEG_VERSION=4.0.2
FROM alpine:3.7 as build
##############################
# Build the NGINX-build image.
FROM alpine:latest as build-nginx
ARG NGINX_VERSION ARG NGINX_VERSION
ARG NGINX_RTMP_VERSION ARG NGINX_RTMP_VERSION
# Build dependencies. # Build dependencies.
RUN apk add --update \ RUN apk add --update \
binutils \
binutils-libs \
build-base \ build-base \
ca-certificates \ ca-certificates \
curl \ curl \
@ -52,12 +52,14 @@ RUN cd /tmp/nginx-${NGINX_VERSION} && \
--with-debug && \ --with-debug && \
cd /tmp/nginx-${NGINX_VERSION} && make && make install cd /tmp/nginx-${NGINX_VERSION} && make && make install
###############################
# Build the FFmpeg-build image.
FROM alpine:latest as build-ffmpeg FROM alpine:latest as build-ffmpeg
ARG FFMPEG_VERSION ARG FFMPEG_VERSION
ARG PREFIX=/usr/local ARG PREFIX=/usr/local
# FFmpeg build dependencies. # FFmpeg build dependencies.
RUN apk add --update --no-cache \ RUN apk add --update \
build-base \ build-base \
freetype-dev \ freetype-dev \
gcc \ gcc \
@ -116,8 +118,11 @@ RUN cd /tmp/ffmpeg-${FFMPEG_VERSION} && \
# Cleanup. # Cleanup.
RUN rm -rf /var/cache/* /tmp/* RUN rm -rf /var/cache/* /tmp/*
##########################
# Build the release image.
FROM alpine:latest FROM alpine:latest
LABEL MAINTAINER Alfred Gutierrez <alf.g.jr@gmail.com> LABEL MAINTAINER Alfred Gutierrez <alf.g.jr@gmail.com>
RUN apk add --update \ RUN apk add --update \
ca-certificates \ ca-certificates \
openssl \ openssl \
@ -134,7 +139,7 @@ RUN apk add --update \
x264-dev \ x264-dev \
x265-dev x265-dev
COPY --from=build /opt/nginx /opt/nginx COPY --from=build-nginx /opt/nginx /opt/nginx
COPY --from=build-ffmpeg /usr/local /usr/local COPY --from=build-ffmpeg /usr/local /usr/local
COPY --from=build-ffmpeg /usr/lib/libfdk-aac.so.1 /usr/lib/libfdk-aac.so.1 COPY --from=build-ffmpeg /usr/lib/libfdk-aac.so.1 /usr/lib/libfdk-aac.so.1