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'
|
2020-11-05 07:45:05 +00:00
|
|
|
# Alpine does not support python3 yet, but depot_tools enabled python3
|
|
|
|
# by default. Disable python3 explicitly for now.
|
|
|
|
# See https://github.com/google/shaka-packager/issues/763 for details.
|
|
|
|
ENV GCLIENT_PY3=0
|
2021-06-11 18:05:46 +00:00
|
|
|
# Bypass VPYTHON included by depot_tools, which no longer works in Alpine.
|
|
|
|
ENV VPYTHON_BYPASS="manually managed python not supported by chrome operations"
|
2018-12-19 19:45:40 +00:00
|
|
|
|
|
|
|
# Build shaka-packager
|
2016-05-17 00:41:02 +00:00
|
|
|
WORKDIR shaka_packager
|
CI overhaul based on GitHub Actions
This replaces Travis (for Linux & Mac) and Appveyor (for Windows) with
GitHub Actions. In addition to using GitHub Actions to test PRs, this
also expands the automation of releases so that the only manual steps
are:
1. Create a new CHANGELOG.md entry
2. Create a release tag
Workflows have been create for building and testing PRs and releases,
for publishing releases to GitHub, NPM, and Docker Hub, and for
updating documentation on GitHub Pages.
When a new PR is created, GitHub Actions will:
- Build and test on all combinations of OS, release type, and library
type
Appveyor's workflow took ~2 hours, whereas the new GitHub Actions
workflow takes ~30 minutes.
When a new release tag is created, GitHub Actions will:
- Create a draft release on GitHub
- Extract release notes from CHANGELOG.md & attach them to the
draft release
- Build and test on all combinations of OS, release type, and library
type, aborting if any build or test fails
- Attach release artifacts to the draft release, aborting if any
one artifact can't be prepared
- Fully publish the draft release on GitHub
- Publish the same release to NPM (triggered by GitHub release)
- Publish the same release to Docker Hub (triggered by GitHub release)
- Update the docs on GitHub pages
Closes #336 (GitHub Actions workflow to replace Travis and Appveyor)
b/190743862 (internal; tracking replacement of Travis)
Change-Id: Ic53eef60a8587c5d1487769a0cefaa16eb9b46e7
2021-06-10 21:40:14 +00:00
|
|
|
RUN gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged
|
2018-12-19 19:45:40 +00:00
|
|
|
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
|
2018-12-20 21:26:10 +00:00
|
|
|
RUN apk add --no-cache libstdc++ python
|
2018-12-19 19:45:40 +00:00
|
|
|
COPY --from=builder /shaka_packager/src/out/Release/packager \
|
|
|
|
/shaka_packager/src/out/Release/mpd_generator \
|
2018-12-20 21:26:10 +00:00
|
|
|
/shaka_packager/src/out/Release/pssh-box.py \
|
2018-12-19 19:45:40 +00:00
|
|
|
/usr/bin/
|
2018-12-20 21:26:10 +00:00
|
|
|
# Copy pyproto directory, which is needed by pssh-box.py script. This line
|
|
|
|
# cannot be combined with the line above as Docker's copy command skips the
|
|
|
|
# directory itself. See https://github.com/moby/moby/issues/15858 for details.
|
|
|
|
COPY --from=builder /shaka_packager/src/out/Release/pyproto /usr/bin/pyproto
|