Closed the-teacher closed 1 year ago
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
I think building everything using make docker-build
should work, did you try it?
@toy No I didn't try. I do not know what exactly you mean.
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
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
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
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)
MacOS, M1 pro processor
For documenting a case, without expectation for a solution. Task can be closed anytime.
Technically I build Debian, but for
ARM
Dockerfile
ld-linux-x86-64.so.2
exists foramd/386
, but can not be installed forarm64
platform.So, for now I do not see options to install
jpeg-recompress
andoxipng
on debian underarm64