Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install 32-bit docker container

Tags:

docker

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!

like image 973
Coherent Avatar asked Oct 15 '25 14:10

Coherent


1 Answers

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.

like image 154
David Maze Avatar answered Oct 17 '25 04:10

David Maze



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!