Giter Club home page Giter Club logo

Comments (7)

the-teacher avatar the-teacher commented on June 12, 2024

Stupid things like

root@c0bf955fee2a:/tmp# ln -s  /lib/ld-linux-aarch64.so.1 /lib64/ld-linux-x86-64.so.2
root@c0bf955fee2a:/tmp# oxipng -v
qemu-x86_64: /lib64/ld-linux-x86-64.so.2: Invalid ELF image for this architecture

give nothing

from image_optim_pack.

toy avatar toy commented on June 12, 2024

I think building everything using make docker-build should work, did you try it?

from image_optim_pack.

the-teacher avatar the-teacher commented on June 12, 2024

@toy No I didn't try. I do not know what exactly you mean.

from image_optim_pack.

the-teacher avatar the-teacher commented on June 12, 2024

Looks like you mean makefile from your project. Now I see it.
Looks like I need to have docker in a target container to and to run your Makefile.
I will try

from image_optim_pack.

the-teacher avatar the-teacher commented on June 12, 2024

Btw, I even tried install oxipng via brew and to copy it to Debian arm64 container.
Of course it didn't work :D But I was very curious about it

from image_optim_pack.

the-teacher avatar the-teacher commented on June 12, 2024

Ok. jpeg-recompress works if fully compile it under arm64

oxipng is next to check

#
# docker build -t jpeg-recompress -f Dockerfile --build-arg BUILDPLATFORM="linux/arm64" .
# docker -ti run jpeg-recompress bash

FROM --platform=$BUILDPLATFORM debian:bullseye
ARG BUILDPLATFORM

ENV LD_LIBRARY_PATH=/usr/local/lib
WORKDIR /tmp

RUN apt-get update && apt-get install -y build-essential cmake nasm bash findutils
RUN apt-get install -y wget

COPY extract ./
ENV CPATH=/usr/local/include

# libmozjpeg
RUN wget https://github.com/mozilla/mozjpeg/archive/v4.1.1.tar.gz
RUN mv v4.1.1.tar.gz libmozjpeg-4.1.1.tar.gz

RUN mkdir -p build/libmozjpeg
RUN tar -C build/libmozjpeg --strip-components=1 -xzf libmozjpeg-4.1.1.tar.gz

RUN cd build/libmozjpeg && cmake -DPNG_SUPPORTED=0 . && make install

# jpegarchive
RUN wget https://github.com/danielgtaylor/jpeg-archive/archive/v2.2.0.tar.gz
RUN mv v2.2.0.tar.gz jpegarchive-2.2.0.tar.gz

RUN mkdir -p build/jpegarchive
RUN tar -C build/jpegarchive --strip-components=1 -xzf jpegarchive-2.2.0.tar.gz

RUN cd build/jpegarchive && CFLAGS=-fcommon make install

# cat /etc/os-release

# PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
# NAME="Debian GNU/Linux"
# VERSION_ID="11"
# VERSION="11 (bullseye)"
# VERSION_CODENAME=bullseye
# ID=debian
# HOME_URL="https://www.debian.org/"
# SUPPORT_URL="https://www.debian.org/support"
# BUG_REPORT_URL="https://bugs.debian.org/"

# uname -m

# aarch64

from image_optim_pack.

the-teacher avatar the-teacher commented on June 12, 2024

Ok. After I recompiled everything manually with BUILDPLATFORM="linux/arm64" . and moved compiled files to a tagert container with linux/arm64 - I found that it started to work.

Now I'm going to cleanup my project's Dockerfile and have flash royal for Debian amd/arm

my Dockerfile for experiments.

#
# docker build -t image_processors -f Dockerfile --build-arg BUILDPLATFORM="linux/arm64" .
# docker -ti run image_processors bash

FROM --platform=$BUILDPLATFORM debian:bullseye
ARG BUILDPLATFORM

ENV LD_LIBRARY_PATH=/usr/local/lib
WORKDIR /tmp

RUN apt-get update && apt-get install -y build-essential cmake nasm bash findutils
RUN apt-get install -y wget

COPY extract ./
ENV CPATH=/usr/local/include

# libmozjpeg
RUN wget https://github.com/mozilla/mozjpeg/archive/v4.1.1.tar.gz
RUN mv v4.1.1.tar.gz libmozjpeg-4.1.1.tar.gz

RUN mkdir -p build/libmozjpeg
RUN tar -C build/libmozjpeg --strip-components=1 -xzf libmozjpeg-4.1.1.tar.gz

RUN cd build/libmozjpeg && cmake -DPNG_SUPPORTED=0 . && make install

# jpegarchive
RUN wget https://github.com/danielgtaylor/jpeg-archive/archive/v2.2.0.tar.gz
RUN mv v2.2.0.tar.gz jpegarchive-2.2.0.tar.gz

RUN mkdir -p build/jpegarchive
RUN tar -C build/jpegarchive --strip-components=1 -xzf jpegarchive-2.2.0.tar.gz

RUN cd build/jpegarchive && CFLAGS=-fcommon make install

# oxipng
FROM  rust:1 as oxipng
RUN apt-get update && apt-get install -y build-essential

RUN wget https://github.com/shssoichiro/oxipng/archive/refs/tags/v8.0.0.tar.gz
RUN mv v8.0.0.tar.gz oxipng-v8.0.0.tar.gz

RUN mkdir -p build/oxipng
RUN tar -C build/oxipng --strip-components=1 -xzf oxipng-v8.0.0.tar.gz
RUN cd build/oxipng && cargo build --release && install -c target/release/oxipng /usr/local/bin
# cargo --version
# cargo 1.67.0 (8ecd4f20a 2023-01-10)

from image_optim_pack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.