Comments (6)
Frankly, I do not understand why this is running under qemu at all. See on my arm64 Mac:
$ docker run -it --rm --entrypoint=sh linuxkit/mkimage-vmdk:b55ea46297a16d8a4448ce7f5a2df987a9602b27
# uname -m
x86_64
# ps 1
PID TTY STAT TIME COMMAND
1 pts/0 Ssl 0:00 /usr/bin/qemu-x86_64 /bin/sh sh
Same thing if I run it explicitly:
$ docker run -it --rm --platform=linux/arm64 --entrypoint=sh linuxkit/mkimage-vmdk:b55ea46297a16d8a4448ce7f5a2df987a9602b27
# uname -m
x86_64
# ps 1
PID TTY STAT TIME COMMAND
1 pts/0 Ssl 0:00 /usr/bin/qemu-x86_64 /bin/sh sh
No problems with other (e.g. alpine) images. And the manifest seems correct:
{
"schemaVersion": 2,
"manifests": [
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"digest": "sha256:0a39a85c03694769a9ac93fa709cc225fc177e81b177c250ca3682c69a1b9d63",
"size": 865,
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"digest": "sha256:f545ce6b8fd28a1695bdb4952c093fa30bef55f5db8fdd25c7a4a6741f8784f4",
"size": 865,
"platform": {
"architecture": "arm64",
"os": "linux"
}
}
]
}
as is the arm64 config:
{
"architecture": "arm64",
"config": {
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"DEBIAN_FRONTEND=noninteractive"
],
"Entrypoint": [
"/make-vmdk"
],
"Labels": {
"org.mobyproject.linuxkit.revision": "unknown",
"org.mobyproject.linuxkit.version": "unknown",
"org.opencontainers.image.revision": "7b516aa6e8fda7869554161a9f11befc3f31e1b2",
"org.opencontainers.image.source": "https://github.com/linuxkit/linuxkit"
},
"ArgsEscaped": true,
"OnBuild": null
},
"created": "2022-12-29T23:43:47.935994083Z",
"history": [
{
"created": "2017-12-12T01:44:20.97772974Z",
"created_by": "/bin/sh -c #(nop) ADD file:eb2519421c9794ccc99d483c07f59ba305531bc9b4dc294e74d2ddb7de69e52a in / "
},
{
"created": "2017-12-12T01:44:21.269562823Z",
"created_by": "/bin/sh -c #(nop) CMD [\"bash\"]",
"empty_layer": true
},
{
"created": "2018-01-25T13:00:48.786564417Z",
"created_by": "/bin/sh -c #(nop) ENV DEBIAN_FRONTEND=noninteractive",
"empty_layer": true
},
{
"created": "2018-01-25T13:02:32.488044378Z",
"created_by": "/bin/sh -c apt-get update && apt-get -yq upgrade && apt-get install -yq libguestfs-tools syslinux linux-image-amd64 vim"
},
{
"created": "2022-12-29T23:43:47.935994083Z",
"created_by": "COPY . . # buildkit",
"comment": "buildkit.dockerfile.v0"
},
{
"created": "2022-12-29T23:43:47.935994083Z",
"created_by": "ENTRYPOINT [\"/make-vmdk\"]",
"comment": "buildkit.dockerfile.v0",
"empty_layer": true
}
],
"moby.buildkit.buildinfo.v1": "eyJmcm9udGVuZCI6ImRvY2tlcmZpbGUudjAiLCJzb3VyY2VzIjpbeyJ0eXBlIjoiZG9ja2VyLWltYWdlIiwicmVmIjoiZG9ja2VyLmlvL2xpbnV4a2l0L2d1ZXN0ZnM6YTQwNjdmNGJkNWI4MTU0ODE5NWEzNWM3MTYzOGEzZDg1NzQxNTgxNyIsInBpbiI6InNoYTI1NjplZDI0MzEzYWFlZWQ4OTc0ZjYyNmIzZTNkMjUyNzgzZmY4OTQzZDdhZTBjNjczNTI2YTg4YTg1NzJmMjUxN2NkIn0seyJ0eXBlIjoiaHR0cCIsInJlZiI6Imh0dHA6Ly9idWlsZGtpdC1zZXNzaW9uLzNraDJ6ZG84MWgxeDhjdGR6cXZiazVqaGUiLCJwaW4iOiJzaGEyNTY6YjE5NDYwNGRlNDZkMTczM2UwZGFkYjYxMWM1NDQ4OWU4OTNiYjNiMTdmMDRhYzhjZTY5NWMxZDgwZDFkNjU3MyJ9XX0=",
"os": "linux",
"rootfs": {
"type": "layers",
"diff_ids": [
"sha256:e27a10675c5656bafb7bfa9e4631e871499af0a5ddfda3cebc0ac401dfe19382",
"sha256:934cb6db266090266ab85c259c8f6d33533746c572d8c049085a872af3aca215",
"sha256:381c9d07f1c7c8332fefce3c2b8634f3122008d5328ad3fb7820b4ea045693c3"
]
}
}
from linuxkit.
I think that's because the arm64 image actually contains x86-64 binary of qemu-img?
docker run -it --rm --entrypoint /bin/bash linuxkit/mkimage-vmdk:b55ea46297a16d8a4448ce7f5a2df987a9602b27-arm64 -c 'file $(which qemu-img)'
/usr/bin/qemu-img: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=1d4e7b1bb4fcd292c6407dacc87fd42e500a9a0e, stripped
from linuxkit.
Why should that matter? It can have whatever it wants inside it, but if my command is:
docker run -it --rm --platform=linux/arm64 --entrypoint=sh
Then the one thing it should explicitly launch is sh
. Unless sh
itself is the wrong arch, and docker itself is figuring that out and running qemu
?
from linuxkit.
I think docker
can detect wrong arch and involve emulation as needed:
docker run -it --rm alpine sh -c 'apk -q add file; echo "Native binary:"; file /bin/busybox; busybox uname -a; wget -q https://busybox.net/downloads/binaries/1.35.0-x86_64-linux-musl/busybox; chmod u+x busybox; echo "x86_64 binary:"; file ./busybox; ./busybox uname -a'
Native binary:
/bin/busybox: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-aarch64.so.1, stripped
Linux e87569d9a44b 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 Linux
x86_64 binary:
./busybox: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
Linux e87569d9a44b 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 x86_64 GNU/Linux
And mkimage-vmdk
is based on linuxkit/guestfs
, and from dockerhub linuxkit/guestfs
only has amd64 image
from linuxkit.
Ah, is that it? guestfs
is only amd64?
How interesting, and it is based on debian:stretch
. I am assuming that is for the availability of vm-make-fs
, guestfish
and qemu-img
.
qemu-img
is available in Alpine, but not the others, unfortunately.
Looks like if we move from the older stretch
to the newer bullseye
, we can get the packages. Some packages have changed their naming structure, but it should be doable.
from linuxkit.
Looking a bit deeper, there are four downstream dependencies of the linuxkit/guestfs
image. All four use the same basic tools: virt-make-fs
, guestfish
, qemu-img
. It looks like libguestfs
was available on alpine for a while, but now is not 🤷♂️
from linuxkit.
Related Issues (20)
- Landlock support HOT 1
- Build fails with no useful error message when using iso-bios format on arm64 architecture HOT 3
- enable CONFIG_FANOTIFY_ACCESS_PERMISSIONS
- Missing updated versions of poweroff package HOT 1
- Not able to use locally built docker images with `linuxkit build linuxkit.yml` command HOT 1
- No tagged images on dockerhub since v0.8 HOT 4
- Wrong EFI file in iso, qcow and raw efi images when cross-building
- Docker for Mac Example - Virtualization Framework
- Issue with MacOS example HOT 5
- Failed to build init tarball HOT 2
- kernel BUG: io_uring openat triggers audit reference count underflow HOT 1
- Please enable the VRF kernel module in linuxkit
- Add 'cache push' command to push images by tag
- when using cache push, make push of arch-specific tags optional
- Docker hub binfmt tagging is.. awkward? HOT 2
- kernel-perf for 6.6.x has no bins? HOT 3
- Failed to build init tarball from linuxkit/init:v0.7: Could not pull image linuxkit/init:v0.7: Trusted pull for linuxkit/init:v0.7 failed: targets expired at Thu Sep 7 16:16:02 +0100 2023 HOT 1
- [init] Make cgroups v2 the default
- Fortify finding : Insecure Transport in run_packet.go HOT 4
- --data-file flag not working on MacOS with Virtualization runner HOT 1
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 linuxkit.