3

I'm trying to create a 32-bit docker image with Ubuntu 14.04 and, any time that I run uname, I see that it is x86_64 instead of i386. Could anyone tell me why this is happening?

docker run talex5/lucid32 uname -m

The weird thing is when I look up the architecture type a different way, it says 32-bit:

docker run i386/ubuntu:14.04 file /sbin/init

/sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=c394677bccc720a3bb4f4c42a48e008ff33e39b1, stripped`

This happens consistently whenever I download different docker images that say they are 32-bit and even when I create my own docker image using debootstrap.

Thanks!

2 Answers 2

5

uname reports the version and OS details of the kernel, but Docker containers always use the host system's kernel, and if it's a 64-bit kernel it will report x86_64.

You should see the same results running this with a mixed 32-/64-bit OS install (in Ubuntu land installing packages like libc6:i686); with a 32-bit filesystem tree in a chroot; and in a Docker container; which are all the same case of running 32-bit binaries on a system with a 64-bit kernel.

-1

This is possible these days, with just a simple script. You could use https://github.com/docker-32bit/ubuntu.

2
  • 1
    Thanks for the reply. Running that script and executing uname -i also gives x86_64
    – Coherent
    Oct 16, 2018 at 21:13
  • Have you tried like this too? Oct 16, 2018 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.