forked from cturra/docker-ntp
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
30 lines (21 loc) · 800 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM alpine:3.21
ARG BUILD_DATE
# first, a bit about this container
LABEL org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.authors="Simon Rupf <[email protected]>" \
org.opencontainers.image.documentation=https://github.com/simonrupf/docker-chronyd
# default configuration
ENV NTP_DIRECTIVES="ratelimit\nrtcsync"
# install chrony
RUN apk add --no-cache chrony tzdata && \
rm /etc/chrony/chrony.conf
# script to configure/startup chrony (ntp)
COPY assets/startup.sh /bin/startup
# ntp port
EXPOSE 123/udp
# marking volumes that need to be writable
VOLUME /etc/chrony /run/chrony /var/lib/chrony
# let docker know how to test container health
HEALTHCHECK CMD chronyc -n tracking || exit 1
# start chronyd in the foreground
ENTRYPOINT [ "/bin/startup" ]