Sign inSign up

skoep/ntp

By skoep

•Updated 6 months ago

A Network Time Protocol Server on current Debian with very simple and fast configuration.

Image
0

261

skoep/ntp repository overview

⁠Welcome to Debian / Network Time Protocol Server

This container image provides an NTPv4 server (Chrony) for current Debian systems with particularly simple and secure configuration.

⁠Versioning (Tag)

Versioning is highly dependent on the current Debian version and the chrony version available for it.

MajorMinorPatchDebianChronyAdditional Information
110Trixie (13.4)4.6.1(nothing)

⁠Configuration

The server configuration is recreated based on the environment variables at each startup. The container must be able to use 123/udp to access the internet so that it can determine the time from the specified server / pools.

The default configuration for the Access, Server and Pool Control is set as follows (it must be empty to use the default settings):

  • Access Control (IPv4): 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,169.254.0.0/16
  • Access Control (IPv6): fd00::/8,fe80::/10
  • Server Control: ptbtime1.ptb.de,ptbtime2.ptb.de,ptbtime3.ptb.de,ptbtime4.ptb.de
  • Pool Control:

⁠Environment Variables

VariableDefaultDescription
NTP_PORT123Used UDP Port
NTP_IPv4trueUse IPv4 (true or false)
NTP_IPv6falseUse IPv6 (true or false)
ACCESS_CONTROL(empty)List of allowed IPs
SERVER_CONTROL(empty)The list of servers to be queried
POOL_CONTROL(empty)The list of pools to be queried

⁠Example of a Compose file:

services:
  ntp:
    image: docker.io/skoep/ntp:latest
    container_name: ntp
    hostname: ntp
    domainname: example.com
    restart: unless-stopped
    ports:
      - "123:123/udp"
    environment:
      - TZ=Europe/Berlin

⁠Example of a quadlet for Podman:

[Unit]
Description=NTP Server

[Container]
AutoUpdate=registry

Image=docker.io/skoep/ntp:latest
ContainerName=ntp
HostName=ntp
LogDriver=none
PodmanArgs=--cpus=0.5 --memory=64m
Network=pasta:-u,123:123

Environment=TZ=Europe/Berlin
Environment=NTP_IPv4=true
Environment=ACCESS_CONTROL=192.168.100.0/24
Environment=POOL_CONTROL=de.pool.ntp.org

[Service]
Restart=always
TimeoutStartSec=1

[Quadlet]
DefaultDependencies=false

[Install]
WantedBy=default.target

⁠FAQ

questions and answers

⁠How much memory should I allocate to the container?

The container is very economical. 16MB is sufficient.

⁠How much disk space does the container require?

The container is very economical. 256MB is sufficient.

⁠Why am I getting an error when using port 123?

Please note that containers running as a rootless user cannot simply open ports below 1024. This is because ports 0 to 1023 are privileged, and the operating system does not allow unprivileged containers to use them. However, this can be overridden with a simple command to move the limit. For this to take effect, a reboot is essential after setting the file.

echo "net.ipv4.ip_unprivileged_port_start=123" | sudo tee /etc/sysctl.d/01-SetUnprivilegedPort.conf

Tag summary

Content type

Image

Digest

sha256:cf35e5cb9…

Size

77.1 MB

Last updated

6 months ago

docker pull skoep/ntp