-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (48 loc) · 2.53 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# =============================================================================
# Dockerfile
# Chrony Time Server Container
# https://github.com/aessing/chronyd-container
# -----------------------------------------------------------------------------
# Developer.......: Andre Essing (https://github.com/aessing)
# (https://www.linkedin.com/in/aessing/)
# -----------------------------------------------------------------------------
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
# =============================================================================
###############################################################################
# Get the base Linux image
FROM alpine:3.21.2
###############################################################################
# Set parameters
ARG BUILD_DATE
ENV TZ='UTC'
EXPOSE 123/udp
VOLUME ["/etc/chrony"]
###############################################################################
# Set some information
LABEL org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.authors="Andre Essing" \
org.opencontainers.image.description="Container running time server Chrony on Alpine to serve time inside of your network without host permissions needed." \
org.opencontainers.image.documentation="https://github.com/aessing/chronyd-container" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.title="Chrony Time Server Container" \
org.opencontainers.image.url="https://github.com/aessing/chronyd-container" \
org.opencontainers.image.vendor="Andre Essing"
################################################### ############################
# Install chronyd and necessary packages
RUN apk --update --no-cache upgrade \
&& apk add --update --no-cache ca-certificates chrony tzdata \
&& rm -rf /var/cache/apk/* \
&& update-ca-certificates \
&& cp /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo $TZ > /etc/timezone \
&& rm -f /etc/chrony/chrony.conf /run/chrony/*
###############################################################################
# Copy files
COPY container-files/chrony.conf /etc/chrony/chrony.conf
###############################################################################
# Start chronyd
CMD [ "/usr/sbin/chronyd", "-d", "-x"]
###############################################################################
#EOF