Giter Site home page Giter Site logo

Comments (5)

junaruga avatar junaruga commented on June 21, 2024 2

@vk496 good point! thanks for the feedback!

Certainly /usr/bin/qemu-i386-static is not included in the result of docker run --rm --privileged multiarch/qemu-user-static --reset -p yes .
But it actually works.

Which kind of Linux distribution's i386 container do you want to run?

If you want to run ubuntu's i386 container image, using i386/ubuntu image ( https://hub.docker.com/r/i386/ubuntu/ ) looks good.
Here is the i386 's case with the i386 image with the Travis CI.

You can refer this repository's "i386" case in .travis.yml.
https://github.com/junaruga/ci-multi-arch-test/blob/master/.travis.yml#L24-L27
https://travis-ci.org/junaruga/ci-multi-arch-test/jobs/567486350

file command shows 32-bit for the compiled binary on the environment.
bin/hello binary (C program to identity the environment) shows 32-bit.

$ file bin/hello
bin/hello: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib, for GNU/Linux 3.2.0, BuildID[sha1]=48eb3582abea27022b746ae6587bda9767896eaf, not stripped

$ bin/hello
Hello World!
Endian Type: Little-endian
Bit: 32-bit
Sizeof {int, long, long long, void*, size_t, off_t}: {4, 4, 8, 4, 4, 4}

The tricky point is when uname command shows x86_64, it can be actually i386 environment depending on the environment.
Because there are 2 types of architectures (architecture by uname command and actual architecture such as used in a part of a deb or a RPM package name), though I do not understand it well.
Same CPU type's 32-bit binary can work on the 64-bit host environment.

When you want to run fedora i386 image, unfortunately it does not exist on both DockerHub and official container repo.
https://hub.docker.com/_/fedora
https://registry.fedoraproject.org/repo/fedora/tags/

from qemu-user-static.

junaruga avatar junaruga commented on June 21, 2024

Debian, Alpine and CentOS has the i386 image too.
i386/debian : https://hub.docker.com/_/debian
i386/alpine : https://hub.docker.com/_/alpine
i386/centos : https://hub.docker.com/_/centos

If you just want to run 32-bit architecture's container, a Linux distribution's ARM-32 bit image can be the alternative of i386 such as arm32v7/fedora image: https://hub.docker.com/r/arm32v7/fedora/

from qemu-user-static.

junaruga avatar junaruga commented on June 21, 2024

Searched keywords: i386, i686, Intel 32-bit

from qemu-user-static.

vk496 avatar vk496 commented on June 21, 2024

Thanks for your reply! I was interesting in compile native i386 code.

It was recently added with the docker/buildx#128 petition.

from qemu-user-static.

junaruga avatar junaruga commented on June 21, 2024

Sure. Good news from docker buildx. I like it too. :)

from qemu-user-static.

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.