Comments (4)
Looks like you're already working on a PR to fix that, thanks!
from docker.
Hmm, almost. But MIPS is causing issues.
I added a dumb run it test which sure enough reproduces this ticket. Adding my hypothesised one line fix fixes every platform except MIPS which is raising Docker's not so informative wrong architecture error.
Running it locally gives me the same thing:
> docker build --platform linux/mips_24kc --build-arg 'DOWNLOAD_FILE=openwrt-.*-rootfs.tar.gz' --build-arg WORKDIR=/ --build-arg USER=root --build-arg VERSION_PATH=snapshots --build-arg TARGET=malta/be --build-arg BASE_IMAGE=scratch --build-arg CMD=ash .
[+] Building 2.6s (22/22) FINISHED
=> [internal] load .dockerignore 0.0s
...
=> => writing image sha256:b3d596932ac4091b06535b990144d701814f26af08d573bb4484430b362005d3 0.0s
> docker run --platform=linux/mips_24kc sha256:b3d596932ac4091b06535b990144d701814f26af08d573bb4484430b362005d3 uname -m
exec /bin/uname: exec format error
I wasn't too sure what Docker/qemu aliases as mips_24kc
(for the --platform
flag) so I downloaded the rootfs tarball and tried to empirically determine which qemu emulator it needs:
wget https://downloads.openwrt.org/snapshots/targets/malta/be/openwrt-malta-be-default-rootfs.tar.gz
tar xf openwrt-malta-be-default-rootfs.tar.gz
for qemu in /bin/qemu-*static; echo $qemu; $qemu lib/libc.so; end
qemu-mips-static
is the emulator that matches the architecture of the binaries in that tarball which corresponds to --platform=linux/mips
:
> docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes | grep mips
Setting /usr/bin/qemu-mips-static as binfmt interpreter for mips
Setting /usr/bin/qemu-mipsel-static as binfmt interpreter for mipsel
Setting /usr/bin/qemu-mipsn32-static as binfmt interpreter for mipsn32
Setting /usr/bin/qemu-mipsn32el-static as binfmt interpreter for mipsn32el
Setting /usr/bin/qemu-mips64-static as binfmt interpreter for mips64
Setting /usr/bin/qemu-mips64el-static as binfmt interpreter for mips64el
Setting --platform=linux/mips
also doesn't work though:
> docker build --platform linux/mips -q --build-arg 'DOWNLOAD_FILE=openwrt-.*-rootfs.tar.gz' --build-arg WORKDIR=/ --build-arg USER=root --build-arg VERSION_PATH=snapshots --build-arg TARGET=malta/be --build-arg BASE_IMAGE=scratch --build-arg CMD=ash .
sha256:f8e5382d05afe40ea1618ba2dad3f1b2b1b3dd62a5dc744851b304682d465fbc
> docker run --platform=linux/mips sha256:f8e5382d05afe40ea1618ba2dad3f1b2b1b3dd62a5dc744851b304682d465fbc uname -m
exec /bin/uname: exec format error
I suspect that this reveals the cause:
> docker run --platform=linux/mips sha256:f8e5382d05afe40ea1618ba2dad3f1b2b1b3dd62a5dc744851b304682d465fbc /lib/libc.so
qemu-mipsn32-static: /lib/libc.so: Invalid ELF image for this architecture
Docker is using qemu-mipsn32-static
instead of qemu-mips-static
.
So unless you have any ideas, I think the best I can do is fix the others and disable MIPs rootfs then poke around the Docker community to see why Docker is using the wrong qemu emulator.
from docker.
@dangowrt do you have an idea on how to treat this?
from docker.
Thank you for the insights, very helpful! I'd be fine to drop it for now
from docker.
Related Issues (20)
- kmodloader: no module folders for kernel version 6.2.2-arch1-1 found HOT 1
- kmodloader: no module folders for kernel version 6.2.2-arch1-1 found HOT 2
- mikrotik container HOT 4
- openwrt/imagebuilder:x86-64-v22.03.4 is building master.... HOT 7
- Add sudo to the container HOT 2
- Add 23.05 to cron?
- Building `libnl` with the sdk fails HOT 2
- A new kernel breaks image builder images HOT 12
- Proper documentation request HOT 2
- feature request: create and auto update Dev Container Templates repo
- Error: chdir to cwd ("/home/build/openwrt") HOT 1
- ath79-generic-openwrt-23.05 is configured for the mikrotic target instead HOT 3
- Release images for loongarch64
- Add latest version tag of a milestone
- Provide a guide for using the image HOT 5
- no network with net_admin Capability
- tag ramips-mt7621-22.03.2 is same as ramips-mt7620-22.03.2 HOT 1
- Dockerfile: add "feeds.conf" to "imagebuilder" too HOT 2
- Why do snapshot images stop receiving updates? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker.