Skip to content

FIXED #1659 : fixed the dockerfile #1660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions docker/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,38 @@ FROM alpine:latest as base

FROM base as builder

RUN apk add --no-cache --update git curl gcc cmake glew glfw \
RUN apk update && apk add --no-cache --update \
git curl gcc cmake glew glfw \
tesseract-ocr-dev leptonica-dev clang-dev llvm-dev make pkgconfig \
zlib-dev libpng-dev libjpeg-turbo-dev openssl-dev freetype-dev libxml2-dev
zlib-dev libpng-dev libjpeg-turbo-dev openssl-dev freetype-dev libxml2-dev bash cargo dos2unix

RUN cd && git clone https://github.com/gpac/gpac
WORKDIR root/gpac/
RUN ./configure && make && make install-lib && cd && rm -rf /root/gpac
WORKDIR /root

RUN git clone https://github.com/gpac/gpac.git
WORKDIR /root/gpac
RUN ./configure && make && make install-lib && rm -rf /root/gpac

WORKDIR /root
RUN git clone https://github.com/CCExtractor/ccextractor.git
RUN apk add bash cargo
RUN git clone https://github.com/CCExtractor/ccextractor.git

RUN find /root/ccextractor -type f -exec dos2unix {} +

RUN ls -la /root/ccextractor && ls -la /root/ccextractor/linux

RUN export LIB_CLANG_PATH=$(find / -name 'libclang*.so*' 2>/dev/null | grep -v 'No such file' | head -n 1 | xargs dirname)
RUN cd /root/ccextractor/linux && ./pre-build.sh && ./build

RUN cp /root/ccextractor/linux/ccextractor /ccextractor && rm -rf ~/ccextractor
WORKDIR /root/ccextractor/linux
RUN chmod +x pre-build.sh && ./pre-build.sh
RUN chmod +x build && ./build

RUN cp /root/ccextractor/linux/ccextractor /ccextractor && rm -rf /root/ccextractor

FROM base as final

RUN find / -name 'libz.so*' 2>/dev/null
RUN find / -name 'libssl.so*' 2>/dev/null
RUN find / -name 'libcrypto.so*' 2>/dev/null

COPY --from=builder /lib/ld-musl-x86_64.so.1 /lib/
COPY --from=builder /usr/lib/libtesseract.so.5 /usr/lib/
COPY --from=builder /usr/lib/libleptonica.so.6 /usr/lib/
Expand All @@ -33,16 +47,14 @@ COPY --from=builder /usr/lib/libgif.so.7 /usr/lib/
COPY --from=builder /usr/lib/libtiff.so.6 /usr/lib/
COPY --from=builder /usr/lib/libwebp.so.7 /usr/lib/
COPY --from=builder /usr/lib/libwebpmux.so.3 /usr/lib/
COPY --from=builder /lib/libz.so.1 /lib/
COPY --from=builder /lib/libssl.so.3 /lib/
COPY --from=builder /lib/libcrypto.so.3 /lib/
COPY --from=builder /usr/lib/liblzma.so.5 /usr/lib/
COPY --from=builder /usr/lib/libzstd.so.1 /usr/lib/
COPY --from=builder /usr/lib/libsharpyuv.so.0 /usr/lib/

COPY --from=builder /ccextractor /
COPY --from=builder /usr/lib/libssl.so.3 /usr/lib/
COPY --from=builder /usr/lib/libcrypto.so.3 /usr/lib/

ENTRYPOINT [ "/ccextractor" ]

CMD [ "/ccextractor" ]
COPY --from=builder /ccextractor /

ENTRYPOINT ["/ccextractor"]
CMD ["/ccextractor"]