Skip to content

[BUG] : Need to update docker file as docker build is failing for higher versions of this project #1659

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
Ni1esh-Yadav opened this issue Jan 29, 2025 · 9 comments

Comments

@Ni1esh-Yadav
Copy link

Description:

The current Dockerfile needs an update as the Docker build process is failing due to outdated dependencies and/or configuration issues.

Steps to Reproduce:

  1. Clone the repository:
    git clone https://github.com/CCExtractor/ccextractor.git
    cd ccextractor/docker
  2. Build the Docker image:
    docker build -t ccextractor .
  3. The build fails with errors

ERROR [builder 1/10] RUN apk add --no-cache --update git curl gcc cmake glew glfw tesseract-ocr-dev leptonica-dev clang-dev llvm-dev make pkg 2)=> ERROR [builder 7/8] RUN cd /root/ccextractor/linux && ./pre-build.sh && ./build 0.5s


[builder 7/8] RUN cd /root/ccextractor/linux && ./pre-build.sh && ./build:
0.407 /bin/sh: cd: line 0: can't cd to /root/ccextractor/linux: No such file or directory


dockerfile:19
17 | RUN git clone https://github.com/CCExtractor/ccextractor.git
18 | RUN export LIB_CLANG_PATH=$(find / -name 'libclang*.so*' 2>/dev/null | grep -v 'No such file' | head -n 1 | xargs dirname)
19 | >>> RUN cd /root/ccextractor/linux && ./pre-build.sh && ./build
20 |
21 | # Copy the ccextractor binary
ERROR: failed to solve: process "/bin/sh -c cd /root/ccextractor/linux && ./pre-build.sh && ./build" did not complete successfully: exit code: 2]

Expected Behavior:

The Docker image should build successfully without errors.

Actual Behavior:

The build process fails due to outdated dependencies and/or broken installation steps in the Dockerfile.

Suggested Fix:

  • Update the base image to a more recent version.
  • Ensure all dependencies install correctly.
  • Fix any broken commands in the Dockerfile.
  • Test the build on different environments (Linux, Windows WSL, Mac).

System Information:

  • OS: (e.g., Ubuntu 22.04, Windows 11 WSL2, macOS)
@vatsalkeshav
Copy link
Contributor

I would like to work on this

@Ni1esh-Yadav
Copy link
Author

I would like to work on this

i have already fixed this issue waiting for reply from the maintainers

@Ni1esh-Yadav
Copy link
Author

btw, the build still fails on "docker build -t ccextractor ."

Which os you are using??

@Ni1esh-Yadav
Copy link
Author

btw, the build still fails on "docker build -t ccextractor ."

FROM alpine:latest as base

FROM base as builder

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 bash cargo dos2unix

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 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)

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/
COPY --from=builder /usr/local/lib/libgpac.so.12 /usr/local/lib/
COPY --from=builder /usr/lib/libstdc++.so.6 /usr/lib/
COPY --from=builder /usr/lib/libgcc_s.so.1 /usr/lib/
COPY --from=builder /usr/lib/libgomp.so.1 /usr/lib/
COPY --from=builder /usr/lib/libpng16.so.16 /usr/lib/
COPY --from=builder /usr/lib/libjpeg.so.8 /usr/lib/
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 /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 /usr/lib/libssl.so.3 /usr/lib/
COPY --from=builder /usr/lib/libcrypto.so.3 /usr/lib/

COPY --from=builder /ccextractor /

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

This is the updated docker file change it with existing one and then try to run docker build -t ccextractor .

@ShubhamVG
Copy link

@Ni1esh-Yadav Just tried and the latest dockerfile works. Try it out and close the issue or put an update. Looking forwards to it. Thanks.

@Ni1esh-Yadav
Copy link
Author

Just waiting for the maintainers to respond so I can close it as in few systems the docker build is failing that's why I have raised a issue!! Thank you

@cfsmp3
Copy link
Contributor

cfsmp3 commented Apr 11, 2025

Just waiting for the maintainers to respond so I can close it as in few systems the docker build is failing that's why I have raised a issue!! Thank you

Are you talking about #1660 ?
It currently has merge conflicts.

But if the current master is working (I assume someone else also fixed it), is there a problem right now?

@Ni1esh-Yadav
Copy link
Author

Okay I will be checking the updated docker file and if it works I will close this pr and if not I will resolve the merge conflict.

@steel-bucket
Copy link
Contributor

steel-bucket commented May 13, 2025

Hi @Ni1esh-Yadav Can you try with
docker build --platform linux/amd64 -t ccextractor .
with the main branch's build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants