2

I was trying to run 32 bit Centos in container:

sudo docker run -it i386/centos:6

Inside container I run command uname-a in order to know it is 32 bit. Got output:

4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

According to my understanding it is 64 bit version and not expected 32 bit one?

What I do wrong while getting 32 bit Centos?

vico
  • 17,051
  • 45
  • 159
  • 315
  • Yes, it is a 64-bit version. From which repo you pulled the container? – Hamza Anis Mar 17 '18 at 09:03
  • Try this one [here](https://hub.docker.com/r/toopher/centos-i386/) – Hamza Anis Mar 17 '18 at 09:06
  • Possible duplicate of [$(uname -a) returning the same in docker host or any docker container](https://stackoverflow.com/questions/31012297/uname-a-returning-the-same-in-docker-host-or-any-docker-container) – ks1322 Mar 17 '18 at 09:20

1 Answers1

3

Containers share kernel with the host system. Thats why you see ubuntu in the output which is your host system kernel. These containers only have 32bit packages installed and they will work fine with your 64bit kernel.

Farhad Farahi
  • 35,528
  • 7
  • 73
  • 70
  • Does yum install pick up 32-bit packages? When I used to do `chroot`, I had to prefix `linux32` command. – Nishant Nov 23 '20 at 06:56
  • https://stackoverflow.com/questions/26490935/how-to-fake-cpu-architecture-in-docker-container seems to have some answers! – Nishant Nov 23 '20 at 07:22