-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installing typos in Ubuntu Docker image #60
Comments
Does the x86_64 build work in an arm64 container? |
I'm not a huge expert on Docker and how it handles different architecture, but I've got
|
I'm quite confused. How is an x86-64 binary working in an ARM container? I don't think that in general it would make sense to fall back to x86 binaries on normal ARM platforms, like if you were running Linux on an actual ARM-powered system. I wonder what's going on in Docker to make this work. |
ChatGPT says: Running x86-64 Binaries in ARM ContainersRunning an x86-64 binary in an ARM container involves a few key techniques: 1. Emulation with QEMUQEMU is an open-source emulator that can translate x86-64 instructions to ARM instructions on the fly. Docker integrates with QEMU to provide this CPU emulation. How it Works
2. Multi-Architecture Docker ImagesDocker supports multi-architecture images, allowing for both ARM and x86-64 binaries within a single image. Tools
3. Cross-CompilingCross-compiling the application for ARM directly avoids the need for emulation by creating ARM-native binaries. How it Works
4. Docker Desktop and Other PlatformsPlatforms like Docker Desktop on macOS or Windows use QEMU for emulation to run ARM containers on x86-64 hosts. SummaryEmulation with QEMU is commonly used for running x86-64 binaries in ARM containers. For better performance, native ARM compilation or multi-architecture Docker images are preferred. |
Hmm, I'm still not sure how this worked. From my reading, it seems multi-arch images (option 2), it's just a way to distribute an image that can run on different host architectures. But inside the container image you should still only be able to run the architecture provided by the host. And for the other options, it doesn't seem like it produces a situation where you can run x86-64 binaries on an ARM host or vice versa. Here's me trying to run an arm64 image:
That's what I'd expect. I know that on macOS Docker uses VMs under the hood, but I still don't understand how you produce a VM that can run both architecture's binaries! |
I have to install my dot files in a bunch of slightly different scenarios, so I occasionally test installing them in a Docker container. I'm having an issue getting
ubi
to installtypos
. Not urgent or even important, but I figured I'd open an issue.My
docker-compose.yml
includesInside the container:
Would it be reasonable to fall back to
typos-v1.24.1-x86_64-unknown-linux-musl.tar.gz
in this case?The text was updated successfully, but these errors were encountered: