Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Ubuntu 20.04 image fails to provide realtime clock on arm32v7 raspberry pi #196

Closed
juliusjava opened this issue Nov 19, 2020 · 4 comments
Closed

Comments

@juliusjava
Copy link

When I run a docker image, which is based on ubuntu:20.04 on my raspberry pi 3B (arm32v7 architecture) and execute date with sleep in bash multiple times, it outputs:

Mon Mar 2 0:46:19 UTC 1970
sleep: cannot read realtime clock: Operation not permitted
Sat Feb 28 08:07:23 UTC 1970
sleep: cannot read realtime clock: Operation not permitted
Tue Mar 3 03:15:07 UTC 1970

JVM used inside such a container throws the following warning:
OpenJDK Server VM warning: No monotonic clock was available - timed services may be adversely affected if the time-of-day clock changes
And finally this causing an issue, when non of java application wants to start normally. Or if it starts, if works unpredictable. But usually logs stay only with this warning.
Guys from AdoptOpenJDK helped to track down this problem AdoptOpenJDK/openjdk-docker#469.

Reproduction info:
Dockerfile

# ARCH=arm32v7|amd64
ARG ARCH=amd64
FROM ${ARCH}/ubuntu:20.04
COPY execution.sh /execution.sh
CMD /execution.sh

execution.sh

#!/bin/bash

date
sleep 1
date
sleep 1
date

Building image
docker build --build-arg ARCH=arm32v7 -t custom-image:local .
Executing
docker run custom-image:local

@tianon
Copy link
Owner

tianon commented Nov 19, 2020

This is unfortunately the same underlying issue as #183, #184, #195.

In other words, in order to resolve this, your host needs to have installed:

  • Docker version 19.03.9 or newer
  • libseccomp version 2.4.2 or newer

@juliusjava
Copy link
Author

Well, that is strange. I have Docker 19.03.13, but the other one seems to be missing. I will try to install it.

Strange fact is that with tomcat:7-jdk8-adoptopenjdk-hotspot or alpine images there is no such problem, so initially I though that this is not my raspberry hardware or OS issues.

@juliusjava
Copy link
Author

According to this page https://packages.ubuntu.com/xenial/libseccomp2 libseccomp newest compatible librarry version for armhf architecture is only 2.2.3-3ubuntu3.
When I tried to update it using apt-get install.., it "said" to me that it is the newest version (which was lower than suggested 2.4.2).
But I was able to find the newer version (2.5.0) compiled for armhf here https://packages.debian.org/sid/armhf/libseccomp2/download and manually installed it.
My raspberry pi survided it and the issue have disappeared!

So the greatful results of this are:

  • date inside a test container returns correct data
  • JVM inside such a container does not return mentioned warning
  • finally my java application inside a container deploys and operates correctly

Thank you @tianon !

@guysoft
Copy link

guysoft commented Feb 3, 2021

Workaround here was to download manually the package https://packages.debian.org/buster-backports/libseccomp2

Then dpkg of it (libc was up to date).
Solved the issue for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants