subconverter/scripts/Dockerfile
riolurs 617a807187
Some checks are pending
GitHub CI / Linux ${{ matrix.arch }} Build (aarch64, subconverter_aarch64, ubuntu-24.04-arm) (push) Waiting to run
GitHub CI / Linux ${{ matrix.arch }} Build (amd64, subconverter_linux64, ubuntu-latest) (push) Waiting to run
GitHub CI / Linux ${{ matrix.arch }} Build (armv7, subconverter_armv7, ubuntu-24.04-arm) (push) Waiting to run
GitHub CI / Linux ${{ matrix.arch }} Build (x86, subconverter_linux32, ubuntu-latest) (push) Waiting to run
GitHub CI / macOS ${{ matrix.arch }} Build (arm, subconverter_darwinarm, macos-14) (push) Waiting to run
GitHub CI / macOS ${{ matrix.arch }} Build (x86, subconverter_darwin64, macos-13) (push) Waiting to run
GitHub CI / Windows ${{ matrix.arch }} Build (amd64, subconverter_win64, x86_64, MINGW64) (push) Waiting to run
GitHub CI / Windows ${{ matrix.arch }} Build (x86, subconverter_win32, i686, MINGW32) (push) Waiting to run
Publish Docker Image / Build ${{ matrix.platform }} for Docker Hub (ubuntu-24.04-arm, linux/arm/v7) (push) Waiting to run
Publish Docker Image / Build ${{ matrix.platform }} for Docker Hub (ubuntu-24.04-arm, linux/arm64) (push) Waiting to run
Publish Docker Image / Build ${{ matrix.platform }} for Docker Hub (ubuntu-latest, linux/386) (push) Waiting to run
Publish Docker Image / Build ${{ matrix.platform }} for Docker Hub (ubuntu-latest, linux/amd64) (push) Waiting to run
Publish Docker Image / Build ${{ matrix.platform }} for GHCR (ubuntu-24.04-arm, linux/arm/v7) (push) Waiting to run
Publish Docker Image / Build ${{ matrix.platform }} for GHCR (ubuntu-24.04-arm, linux/arm64) (push) Waiting to run
Publish Docker Image / Build ${{ matrix.platform }} for GHCR (ubuntu-latest, linux/386) (push) Waiting to run
Publish Docker Image / Build ${{ matrix.platform }} for GHCR (ubuntu-latest, linux/amd64) (push) Waiting to run
Publish Docker Image / Merge Docker Hub (push) Blocked by required conditions
Publish Docker Image / Merge GHCR (push) Blocked by required conditions
Modify the basic information.
2025-06-13 11:55:12 +08:00

65 lines
2.3 KiB
Docker

FROM alpine:3.16 AS builder
LABEL maintainer="metacubex.official@gmail.com"
ARG THREADS="4"
ARG SHA=""
# build minimized
WORKDIR /
RUN set -xe && \
apk add --no-cache --virtual .build-tools git g++ build-base linux-headers cmake python3 && \
apk add --no-cache --virtual .build-deps curl-dev rapidjson-dev pcre2-dev yaml-cpp-dev && \
git clone https://github.com/ftk/quickjspp --depth=1 && \
cd quickjspp && \
git submodule update --init && \
cmake -DCMAKE_BUILD_TYPE=Release . && \
make quickjs -j $THREADS && \
install -d /usr/lib/quickjs/ && \
install -m644 quickjs/libquickjs.a /usr/lib/quickjs/ && \
install -d /usr/include/quickjs/ && \
install -m644 quickjs/quickjs.h quickjs/quickjs-libc.h /usr/include/quickjs/ && \
install -m644 quickjspp.hpp /usr/include && \
cd .. && \
git clone https://github.com/PerMalmberg/libcron --depth=1 && \
cd libcron && \
git submodule update --init && \
cmake -DCMAKE_BUILD_TYPE=Release . && \
make libcron -j $THREADS && \
install -m644 libcron/out/Release/liblibcron.a /usr/lib/ && \
install -d /usr/include/libcron/ && \
install -m644 libcron/include/libcron/* /usr/include/libcron/ && \
install -d /usr/include/date/ && \
install -m644 libcron/externals/date/include/date/* /usr/include/date/ && \
cd .. && \
git clone https://github.com/ToruNiina/toml11 --branch="v4.3.0" --depth=1 && \
cd toml11 && \
cmake -DCMAKE_CXX_STANDARD=11 . && \
make install -j $THREADS && \
cd .. && \
git clone https://github.com/metacubex/subconverter --depth=1 && \
cd subconverter && \
[ -n "$SHA" ] && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h;\
python3 -m ensurepip && \
python3 -m pip install gitpython && \
python3 scripts/update_rules.py -c scripts/rules_config.conf && \
cmake -DCMAKE_BUILD_TYPE=Release . && \
make -j $THREADS
# build final image
FROM alpine:3.16
LABEL maintainer="metacubex.official@gmail.com"
RUN apk add --no-cache --virtual subconverter-deps pcre2 libcurl yaml-cpp
COPY --from=builder /subconverter/subconverter /usr/bin/
COPY --from=builder /subconverter/base /base/
ENV TZ=Africa/Abidjan
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
RUN echo $TZ > /etc/timezone
# set entry
WORKDIR /base
CMD subconverter
EXPOSE 25500/tcp