A Network Time Protocol Server on current Debian with very simple and fast configuration.
261
This container image provides an NTPv4 server (Chrony) for current Debian systems with particularly simple and secure configuration.
Versioning is highly dependent on the current Debian version and the chrony version available for it.
| Major | Minor | Patch | Debian | Chrony | Additional Information |
|---|---|---|---|---|---|
| 1 | 1 | 0 | Trixie (13.4) | 4.6.1 | (nothing) |
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):
| Variable | Default | Description |
|---|---|---|
| NTP_PORT | 123 | Used UDP Port |
| NTP_IPv4 | true | Use IPv4 (true or false) |
| NTP_IPv6 | false | Use 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 |
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
[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
questions and answers
The container is very economical. 16MB is sufficient.
The container is very economical. 256MB is sufficient.
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
Content type
Image
Digest
sha256:cf35e5cb9…
Size
77.1 MB
Last updated
6 months ago
docker pull skoep/ntp