https://github.com/theohbrothers/docker-chrony
Dockerized chrony based on alpine 🐳
https://github.com/theohbrothers/docker-chrony
buildx chrony docker generate-dockerimagevariants ntp nts
Last synced: 2 months ago
JSON representation
Dockerized chrony based on alpine 🐳
- Host: GitHub
- URL: https://github.com/theohbrothers/docker-chrony
- Owner: theohbrothers
- License: apache-2.0
- Created: 2022-09-19T00:09:26.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-06T09:34:49.000Z (over 1 year ago)
- Last Synced: 2025-03-20T15:24:23.685Z (over 1 year ago)
- Topics: buildx, chrony, docker, generate-dockerimagevariants, ntp, nts
- Language: Dockerfile
- Homepage:
- Size: 61.5 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-chrony
[](https://github.com/theohbrothers/docker-chrony/actions/workflows/ci-master-pr.yml)
[](https://github.com/theohbrothers/docker-chrony/releases/)
[](https://hub.docker.com/r/theohbrothers/docker-chrony)
Dockerized [chrony](https://chrony.tuxfamily.org/) based on alpine.
## Tags
| Tag | Dockerfile Build Context |
|:-------:|:---------:|
| `:4.6`, `:latest` | [View](variants/4.6) |
| `:4.5` | [View](variants/4.5) |
| `:4.3` | [View](variants/4.3) |
| `:4.2` | [View](variants/4.2) |
| `:4.1` | [View](variants/4.1) |
| `:4.0` | [View](variants/4.0) |
| `:3.5.1` | [View](variants/3.5.1) |
## Usage
### No NTS
```sh
# Create a custom config file if needed. See: https://chrony.tuxfamily.org/doc/v4.0/chrony.conf.html#examples
cat - > chrony.conf <<'EOF'
pool pool.ntp.org iburst
initstepslew 10 pool.ntp.org
driftfile /var/lib/chrony/chrony.drift
makestep 1.0 3
rtcsync
allow all
EOF
# Start server
docker run -it -p 123:123/udp -v $(pwd)/chrony.conf:/etc/chrony/chrony.conf:ro theohbrothers/docker-chrony:v4.2
# Start server (sync the system clock)
docker run -it --cap-add SYS_TIME -p 123:123/udp -v $(pwd)/chrony.conf:/etc/chrony/chrony.conf:ro theohbrothers/docker-chrony:v4.2 -d
```
### Upstream NTS
```sh
# Create a custom config file if needed. See: https://chrony.tuxfamily.org/doc/v4.0/chrony.conf.html#examples
cat - > chrony.conf <<'EOF'
server time.cloudflare.com iburst nts
initstepslew 10 time.cloudflare.com
driftfile /var/lib/chrony/chrony.drift
makestep 1.0 3
rtcsync
allow all
EOF
# Start server
docker run -it -p 123:123/udp -v $(pwd)/chrony.conf:/etc/chrony/chrony.conf:ro theohbrothers/docker-chrony:v4.2
# Start server (sync the system clock)
docker run -it --cap-add SYS_TIME -p 123:123/udp -v $(pwd)/chrony.conf:/etc/chrony/chrony.conf:ro theohbrothers/docker-chrony:v4.2 -d
```
### From local system clock
```sh
# Create a custom config file if needed. See: https://chrony.tuxfamily.org/doc/v4.0/chrony.conf.html#examples
cat - > chrony.conf <<'EOF'
initstepslew 10 client1 client3 client6
driftfile /var/lib/chrony/chrony.drift
local stratum 8
rtcsync
allow all
EOF
# Start server
docker run -it -p 123:123/udp -v $(pwd)/chrony.conf:/etc/chrony/chrony.conf:ro theohbrothers/docker-chrony:v4.2
```
## Development
Requires Windows `powershell` or [`pwsh`](https://github.com/PowerShell/PowerShell).
```powershell
# Install Generate-DockerImageVariants module: https://github.com/theohbrothers/Generate-DockerImageVariants
Install-Module -Name Generate-DockerImageVariants -Repository PSGallery -Scope CurrentUser -Force -Verbose
# Edit ./generate templates
# Generate the variants
Generate-DockerImageVariants .
```