Skip to content
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

Update Dockerfile #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update Dockerfile #10

wants to merge 1 commit into from

Conversation

schklom
Copy link

@schklom schklom commented Jul 21, 2022

Remove rar because it does the same job as unrar but is only available for amd64, which makes builds on other platforms break.

It works on arm64 platform.

Remove rar because it does the same (hopefully) job as unrar but is only available for amd64, which makes builds on other platforms break
@bit-man
Copy link

bit-man commented Dec 30, 2023

Fixed in fork https://gitlab.com/the-automation-club/hrconvert2-docker. Let's give a try!

@archef2000
Copy link

Does * to rar conversion work ?

@bit-man
Copy link

bit-man commented Dec 30, 2023

Created an image for testing. Could you pull it and let me know if it works for you?
docker pull bitman09/hrconvert2:3.1

@archef2000
Copy link

2MB zip to rar convertion fails without usefull logs. It successfully unpacks the zip but it just says that it fails to create the rar. (arm64)

@bit-man
Copy link

bit-man commented Jan 1, 2024

@bit-man
Copy link

bit-man commented Jan 1, 2024

Posting followups at https://gitlab.com/the-automation-club/hrconvert2-docker/-/issues/1. Not solved yet

@bit-man
Copy link

bit-man commented Jan 3, 2024

Sadly the convertion code need rar executable to compress in rar format

    // / Handle archiving of rar compatible files.
    if (in_array($UserExtension, $rararr)) $returnData = shell_exec('rar a -ep '.$newPathname.' '.$pathname);

My guess is that modifying the code to use another rar version compatible with others architectures is out of the question (zelon88/HRConvert2#27)

@archef2000
Copy link

I had success running rar with qemu-user-static on arm64. But HRConvert still fails. The executable is working in bash, is available to the www-data user and even a php shell could create the rar file.

My unoptimised code for arm64 only (The total image size is 2.2GB)
Code:

# https://www.rarlab.com/rar/rarlinux-x64-5.1.1.tar.gz
# https://www.rarlab.com/rar/rarlinux-x64-6.0.2.tar.gz

RUN apt update \
    && apt install wget qemu-user-static -y \
    && wget https://www.rarlab.com/rar/rarlinux-x64-5.1.1.tar.gz \
    && tar -xzvf  rarlinux-x64-5.1.1.tar.gz \
    && chmod +x rar/rar

# install needed libaries: /lib64/ld-linux-x86-64.so.2; libstdc++.so.6
RUN wget https://geo.mirror.pkgbuild.com/core/os/x86_64/glibc-2.38-7-x86_64.pkg.tar.zst \
    && apt-get install zstd -y \
    && zstd -d glibc-2.38-7-x86_64.pkg.tar.zst \
    && tar -xvf glibc-2.38-7-x86_64.pkg.tar \
    && mkdir /lib64 \
    && cp lib/ld-linux-x86-64.so.2 /lib64 \
    && wget https://geo.mirror.pkgbuild.com/core/os/x86_64/gcc-libs-13.2.1-3-x86_64.pkg.tar.zst \
    && zstd -d gcc-libs-13.2.1-3-x86_64.pkg.tar.zst \
    && tar -xvf gcc-libs-13.2.1-3-x86_64.pkg.tar
    # qemu-x86_64-static rar/rar a test.rar rarlinux-x64-6.0.2.tar.gz

RUN echo "qemu-x86_64-static /rar/rar $@" > /usr/local/bin/rar && chmod +x /usr/local/bin/rar

@bit-man
Copy link

bit-man commented Jan 3, 2024

Took same approach but using package names instead

        dpkg --add-architecture i386 && \
        apt-get install qemu-user-static libc6-i386-cross libstdc++6-i386-cross -y && \
        cp /usr/i686-linux-gnu/lib/libm.so.6 /lib && \
        cp /usr/i686-linux-gnu/lib/libc.so.6 /lib && \
        cp /usr/i686-linux-gnu/lib/libpthread.so.0 /lib && \
        cp /usr/i686-linux-gnu/lib/ld-linux.so.2 /lib && \
        cp /usr/i686-linux-gnu/lib/libstdc++.so.6 /lib && \
        cp /usr/i686-linux-gnu/lib/libgcc_s.so.1  /lib && \
        wget https://www.rarlab.com/rar/rarlinux-x32-700b3.tar.gz  -O /tmp/rarlinux-x32-700b3.tar.gz && \
        tar -zxvf /tmp/rarlinux-x32-700b3.tar.gz -C /tmp && \
        chmod +x /tmp/rar-arm64 &&  ln -s  /tmp/rar-arm64 /usr/bin/rar; \

@bit-man
Copy link

bit-man commented Jan 3, 2024

Created new images for v3.1 with rar compression. Feel free to use it
docker pull bitman09/hrconvert2:3.1

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

Successfully merging this pull request may close these issues.

3 participants