Docker Community Forums

Share and learn in the Docker community.

Fail to yum update on i386/centos:6 docker image

Hello,

I am trying to run, update and install new packages on centos 6 32 bit on docker but my yum -y update and yum -y install *package* fail.
Below will be the output of the two commands.

Yum update return

libc.so.6(GLIBC_2.2.5)(64bit) is needed by libidn-1.18-2.el6.x86_64
libc.so.6(GLIBC_2.3.4)(64bit) is needed by libidn-1.18-2.el6.x86_64
libc.so.6(GLIBC_2.4)(64bit) is needed by libidn-1.18-2.el6.x86_64
libcurl.so.4 is needed by (installed) gnupg2-2.0.14-9.el6_10.i686
libcurl.so.4 is needed by (installed) python-pycurl-7.19.0-9.el6.i686
libpython2.6.so.1.0 is needed by (installed) rpm-python-4.8.0-59.el6.i686
libpython2.6.so.1.0 is needed by (installed) pygpgme-0.1-18.20090824bzr68.el6.i686
libpython2.6.so.1.0 is needed by (installed) python-pycurl-7.19.0-9.el6.i686
libpython2.6.so.1.0 is needed by (installed) yum-metadata-parser-1.1.2-16.el6.i686
libfreebl3.so is needed by (installed) p11-kit-0.18.5-2.el6_5.2.i686
libfreebl3.so is needed by (installed) p11-kit-trust-0.18.5-2.el6_5.2.i686
libfreebl3.so(NSSRAWHASH_3.12.3) is needed by (installed) p11-kit-0.18.5-2.el6_5.2.i686
libfreebl3.so(NSSRAWHASH_3.12.3) is needed by (installed) p11-kit-trust-0.18.5-2.el6_5.2.i686
 You could try running: rpm -Va --nofiles --nodigest
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx-2020-01-07-15-01oNqLpR.yumtx

Yum install vim return

ld-linux-x86-64.so.2(GLIBC_2.3)(64bit) is needed by libselinux-2.0.94-7.el6.x86_64
libc.so.6()(64bit) is needed by libselinux-2.0.94-7.el6.x86_64
libc.so.6(GLIBC_2.2.5)(64bit) is needed by libselinux-2.0.94-7.el6.x86_64
libc.so.6(GLIBC_2.3)(64bit) is needed by libselinux-2.0.94-7.el6.x86_64
libc.so.6(GLIBC_2.3.4)(64bit) is needed by libselinux-2.0.94-7.el6.x86_64
libc.so.6(GLIBC_2.4)(64bit) is needed by libselinux-2.0.94-7.el6.x86_64
libc.so.6(GLIBC_2.8)(64bit) is needed by libselinux-2.0.94-7.el6.x86_64
libdl.so.2()(64bit) is needed by libselinux-2.0.94-7.el6.x86_64
libdl.so.2(GLIBC_2.2.5)(64bit) is needed by libselinux-2.0.94-7.el6.x86_64
libfreebl3.so is needed by (installed) p11-kit-0.18.5-2.el6_5.2.i686
libfreebl3.so is needed by (installed) p11-kit-trust-0.18.5-2.el6_5.2.i686
libfreebl3.so is needed by (installed) nss-3.36.0-8.el6.i686
libfreebl3.so(NSSRAWHASH_3.12.3) is needed by (installed) p11-kit-0.18.5-2.el6_5.2.i686
libfreebl3.so(NSSRAWHASH_3.12.3) is needed by (installed) p11-kit-trust-0.18.5-2.el6_5.2.i686
nss-softokn-freebl(x86-32) >= 3.14.3-23.3.el6_8 is needed by (installed) nss-softokn-3.14.3-23.3.el6_8.i686
 You could try running: rpm -Va --nofiles --nodigest
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx-2020-01-07-15-030KJRmW.yumtx

Could somebody help me get rid of this problem please ?
Thank you

1 Like

do you solve this problem

The reason is that the package manager relies on the information provided by the kernel (via uname(2)) to decide which versions of packages (for which target architecture) should it install. Though your base image has i386 environment inside, you still run the build on x86_64 kernel, so things become a bit tricky.

When you run the container using docker run, you pass through the entrypoint linux32 - a small program which asks the kernel to pretend that it runs on i386 hardware. However, when you run docker build, the entrypoint is not used by RUNs, so yum sees that it runs on x86_64 kernel, hence the mess with platforms. You may check this answer for more detailed explanation; the issue is pretty similar.

To build your image correctly (installing only i386 packages), run yum and other architecture-sensitive commands in RUNs under linux32, e.g.:

RUN linux32 yum update -y