Coherent
Coherent

Reputation: 2113

How to install 32-bit docker container

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!

Upvotes: 4

Views: 10801

Answers (2)

David Maze
David Maze

Reputation: 158647

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.

Upvotes: 6

mantaray
mantaray

Reputation: 21

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

Upvotes: -1

Related Questions