When I run apt-get dist-upgrade
in Docker container, I'm getting,
Unpacking libc6:i386 (2.31-1) over (2.30-8) ...
Setting up libc6:i386 (2.31-1) ...
Checking for services that may need to be restarted...
Checking init scripts...
Nothing to restart.
sleep: cannot read realtime clock: Operation not permitted
dpkg: error processing package libc6:i386 (--configure):
installed libc6:i386 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
libc6:i386
E: Sub-process /usr/bin/dpkg returned an error code (1)
Does libc 2.31-1 support being run in docker on a host on Debian Testing,
Linux x1c7 5.7.0-1-amd64 #1 SMP Debian 5.7.6-1 (2020-06-24) x86_64 GNU/Linux
When I run inside the container I can see that sleep 0
is calling nanosleep
in libc,
nanosleep(0xffd8eb54, 0, 0xf7dbf4d5, 0x565e24ea) = -1
And running strace sleep 0
, I see it's calling clock_nanosleep_time64
clock_nanosleep_time64(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=0}, 0xff8b0b8c) = -1 EPERM (Operation not permitted)
write(2, "sleep: ", 7sleep: ) = 7
write(2, "cannot read realtime clock", 26cannot read realtime clock) = 26
write(2, ": Operation not permitted", 25: Operation not permitted) = 25
What's going on with the dist-upgrade? Is this on me? I can reproduce this on any machine, all I have to do is
- Install Debian testing on the metal,
- The install docker
- Run the following,
docker run i386/debian:unstable /bin/sh -c "apt-get update && apt-get install -qy libc6:i386; echo TRYING TO SLEEP; sleep 0"
Best Answer
All you have to do is add
--privileged
todocker run