toy / image_optim_pack

Precompiled binaries for image_optim
https://github.com/toy/image_optim
Other
77 stars 13 forks source link

Docker. Debian. Some additional libs are required #25

Closed the-teacher closed 1 year ago

the-teacher commented 1 year ago

I used the original image to copy precompiled bins. Not sure if I did it fully correctly, but looks promising.

When I started to check executable files I found, that some of them needs for some additional dependencies.

Maybe it worth to mention somewhere in documentation.

COPY --from=image_optim /lib/ld-musl-x86_64.so.1   /lib/
COPY --from=image_optim /usr/lib/libstdc++.so.6    /usr/lib/
COPY --from=image_optim /usr/lib/libgcc_s.so.1     /usr/lib/
FROM ghcr.io/toy/image_optim:20221127 as image_optim

FROM debian:10.13

COPY --from=image_optim /usr/local/bin/advpng          /usr/local/bin/
COPY --from=image_optim /usr/local/bin/gifsicle        /usr/local/bin/
COPY --from=image_optim /usr/local/bin/jhead           /usr/local/bin/
COPY --from=image_optim /usr/local/bin/jpeg-recompress /usr/local/bin/
COPY --from=image_optim /usr/local/bin/jpegoptim       /usr/local/bin/
COPY --from=image_optim /usr/local/bin/jpegtran        /usr/local/bin/
COPY --from=image_optim /usr/local/bin/optipng         /usr/local/bin/
COPY --from=image_optim /usr/local/bin/oxipng          /usr/local/bin/
COPY --from=image_optim /usr/local/bin/pngcrush        /usr/local/bin/
COPY --from=image_optim /usr/local/bin/pngout          /usr/local/bin/
COPY --from=image_optim /usr/local/bin/pngquant        /usr/local/bin/

COPY --from=image_optim /usr/local/lib/libjpeg.so.9    /usr/local/lib/
COPY --from=image_optim /usr/local/lib/libpng16.so.16  /usr/local/lib/
COPY --from=image_optim /usr/local/lib/libz.so.1       /usr/local/lib/
COPY --from=image_optim /usr/local/lib/liblcms2.so.2   /usr/local/lib/

# Added manually by me

COPY --from=image_optim /lib/ld-musl-x86_64.so.1   /lib/
COPY --from=image_optim /usr/lib/libstdc++.so.6    /usr/lib/
COPY --from=image_optim /usr/lib/libgcc_s.so.1     /usr/lib/
toy commented 1 year ago

Fine to mention, but I'm not sure if it is the better way to copy dynamic libraries instead of compiling on debian against glibc. Also at least libstdc++.so.6 and libgcc_s.so.1 can be installed using package manager, but again I'm not sure if it is better.

the-teacher commented 1 year ago

@toy no problem. It was just a quick solution. I just wanted to let you know. Issue could be closed. There is nothing to solve actually.

toy commented 1 year ago

Have a look at https://github.com/toy/image_optim_pack/commit/7f7776dc7b340d9138b7005e8463c8b58be61574 and https://github.com/toy/image_optim_pack/pkgs/container/image_optim/56843273?tag=latest-debian