Updated docker File
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 32s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 32s
This commit is contained in:
@@ -21,11 +21,12 @@ ADD https://api.github.com/repos/chrisb86/nsupdate/git/refs/heads/main /.git-has
|
||||
COPY nsupdate.sh /usr/local/bin/nsupdate.sh
|
||||
RUN chmod +x /usr/local/bin/nsupdate.sh
|
||||
|
||||
## Setup cron job
|
||||
RUN echo "${SCHEDULE} sh /usr/local/bin/nsupdate.sh" >> /etc/crontabs/root
|
||||
COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||
|
||||
## Start crond
|
||||
CMD [ "crond", "-l", "2", "-f" ]
|
||||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
|
||||
CMD [ "crond", "-f" ]
|
||||
|
||||
VOLUME /config
|
||||
VOLUME /log
|
||||
@@ -1,4 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "${SCHEDULE} sh nsupdate.sh" >> /etc/crontabs/root
|
||||
crond -l 2 -f > /dev/stdout 2> /dev/stderr &
|
||||
set -eu
|
||||
|
||||
SCHEDULE="${SCHEDULE:-* * * * *}"
|
||||
CRON_LOG_LEVEL="${CRON_LOG_LEVEL:-2}"
|
||||
CRON_FILE="/etc/crontabs/root"
|
||||
|
||||
printf '%s /usr/local/bin/nsupdate.sh\n' "${SCHEDULE}" > "${CRON_FILE}"
|
||||
|
||||
if [ "$#" -gt 0 ]; then
|
||||
if [ "$1" = "crond" ]; then
|
||||
shift
|
||||
exec crond -l "${CRON_LOG_LEVEL}" "$@"
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
exec crond -l "${CRON_LOG_LEVEL}" -f
|
||||
Reference in New Issue
Block a user