Public | Automated Build

Last pushed: 10 months ago
Short Description
chrony network time protocol server
Full Description


Network Time Protocol Server Container


To build the chrony container, some components are required that aren't in the
Base Runtime image.

Build Dependencies

  • pps-tools

How to build the container

docker build --tag=chrony .

How to use the container

The chrony server uses a config file (/etc/chrony.conf:) on the host, this file needs to be created first.
Example contents of /etc/chrony.conf, see 'man chrony.conf' for more options:

server mode 2 # local radio clock
server # local clock
fudge stratum 12 # local fallback clock

Command for running chrony docker container:

  # in privileged mode, try to avoid this:
  # docker run --privileged -v /etc/chrony.conf:/etc/ntp.conf:ro -d chrony
  # better solution with capabilities, needs docker-1.12:
  docker run --net=host --cap-add SYS_TIME -v /etc/chrony.conf:/etc/ntp.conf:ro -d $(IMAGE_NAME)

How to test the chrony server

Commands for testing chrony docker container:

ntpq -c "host localhost -pn

replace localhost with container IP if required

Running on OpenShift

This container requires root in order to run chronyd as chronyd checks for the user ID.
It also requires the SYS_TIME capability.
The required steps are:

oadm policy add-scc-to-user anyuid -z default
oc edit scc anyuid

An editor terminal will open after the last command.
Search for

allowedCapabilities: null

and replace it with



defaultAddCapabilities: null



Save and exit the editor and then deploy the container.

Docker Pull Command
Source Repository