2018-12-19 19:45:40 +00:00
|
|
|
FROM alpine:3.8 as builder
|
2015-07-23 01:49:26 +00:00
|
|
|
|
2018-12-19 19:45:40 +00:00
|
|
|
# Install packages needed for Shaka Packager.
|
|
|
|
RUN apk add --no-cache bash build-base curl findutils git ninja python \
|
|
|
|
bsd-compat-headers linux-headers libexecinfo-dev
|
2015-07-23 01:49:26 +00:00
|
|
|
|
2018-12-19 19:45:40 +00:00
|
|
|
# Install depot_tools.
|
2015-07-23 01:49:26 +00:00
|
|
|
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
2018-12-19 19:45:40 +00:00
|
|
|
ENV PATH $PATH:/depot_tools
|
|
|
|
|
|
|
|
# Alpine uses musl which does not have mallinfo defined in malloc.h. Define the
|
|
|
|
# structure to workaround a Chromium base bug.
|
|
|
|
RUN sed -i \
|
|
|
|
'/malloc_usable_size/a \\nstruct mallinfo {\n int arena;\n int hblkhd;\n int uordblks;\n};' \
|
|
|
|
/usr/include/malloc.h
|
2015-07-23 01:49:26 +00:00
|
|
|
|
2018-12-19 19:45:40 +00:00
|
|
|
ENV GYP_DEFINES='clang=0 use_experimental_allocator_shim=0 use_allocator=none musl=1'
|
|
|
|
|
|
|
|
# Build shaka-packager
|
2016-05-17 00:41:02 +00:00
|
|
|
WORKDIR shaka_packager
|
2018-12-19 19:45:40 +00:00
|
|
|
RUN gclient config https://www.github.com/google/shaka-packager.git --name=src --unmanaged
|
|
|
|
COPY . src
|
|
|
|
RUN gclient sync
|
2015-07-23 01:49:26 +00:00
|
|
|
RUN cd src && ninja -C out/Release
|
2018-12-19 19:45:40 +00:00
|
|
|
|
|
|
|
# Copy only result binaries to our final image.
|
|
|
|
FROM alpine:3.8
|
|
|
|
RUN apk add --no-cache libstdc++
|
|
|
|
COPY --from=builder /shaka_packager/src/out/Release/packager \
|
|
|
|
/shaka_packager/src/out/Release/mpd_generator \
|
|
|
|
/usr/bin/
|