-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM docker.io/library/rust:1.78.0-alpine as cargo | ||
ARG VERSION | ||
WORKDIR /tmp | ||
RUN \ | ||
apk add --no-cache \ | ||
autoconf \ | ||
automake \ | ||
build-base \ | ||
curl \ | ||
linux-headers \ | ||
musl-dev \ | ||
&& \ | ||
curl -fsSL "https://github.com/pendulum-project/ntpd-rs/archive/refs/tags/v${VERSION}.tar.gz" \ | ||
| tar xzf - -C /tmp --strip-components 1 \ | ||
&& cargo build --release | ||
|
||
FROM docker.io/library/alpine:3.19 | ||
|
||
#hadolint ignore=DL3018,DL3059 | ||
RUN apk add --no-cache bash ca-certificates catatonit tzdata | ||
|
||
COPY --from=cargo /tmp/target/release/ntp-daemon /usr/local/bin/ntp-daemon | ||
COPY --from=cargo /tmp/target/release/ntp-ctl /usr/local/bin/ntp-ctl | ||
COPY --from=cargo /tmp/target/release/ntp-metrics-exporter /usr/local/bin/ntp-metrics-exporter | ||
RUN /usr/local/bin/ntp-daemon --help | ||
RUN /usr/local/bin/ntp-ctl --help | ||
RUN /usr/local/bin/ntp-metrics-exporter --help | ||
|
||
COPY ./apps/ntpd-rs/ntp.toml /etc/ntp.toml | ||
COPY ./apps/ntpd-rs/entrypoint.sh /entrypoint.sh | ||
|
||
USER nobody:nogroup | ||
WORKDIR /config | ||
VOLUME ["/config"] | ||
|
||
ENTRYPOINT ["/usr/bin/catatonit", "--"] | ||
CMD ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/goss-org/goss/master/docs/schema.yaml | ||
file: | ||
/usr/local/bin/ntp-daemon: | ||
exists: true | ||
/usr/local/bin/ntp-ctl: | ||
exists: true | ||
/usr/local/bin/ntp-metrics-exporter: | ||
exists: true | ||
/etc/ntp.toml: | ||
exists: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
version=$(curl -sX GET "https://api.github.com/repos/pendulum-project/ntpd-rs/releases/latest" | jq --raw-output '.tag_name' 2>/dev/null) | ||
version="${version#*v}" | ||
version="${version#*release-}" | ||
printf "%s" "${version}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ ! -f "/config/ntp.toml" ]]; then | ||
printf "Copying over default configuration ...\n" | ||
cp /etc/ntp.toml /config/ntp.toml | ||
fi | ||
|
||
#shellcheck disable=SC2086 | ||
exec \ | ||
/usr/local/bin/ntp-daemon \ | ||
--config /config/ntp.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
app: ntpd-rs | ||
channels: | ||
- name: stable | ||
platforms: ["linux/amd64", "linux/arm64"] | ||
stable: true | ||
tests: | ||
enabled: true | ||
type: cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[[server]] | ||
listen = "0.0.0.0:123" |