mirror of
https://github.com/linuxserver/docker-ddclient.git
synced 2026-02-20 03:15:49 +08:00
commit
99394dbea4
10
Dockerfile
10
Dockerfile
@ -6,6 +6,9 @@ ARG BUILD_DATE
|
||||
ARG VERSION
|
||||
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||
|
||||
# copy local files
|
||||
COPY root/ /
|
||||
|
||||
# install build time dependencies
|
||||
RUN \
|
||||
apk add --no-cache --virtual=build-dependencies \
|
||||
@ -39,6 +42,9 @@ RUN \
|
||||
tar xf /tmp/ddclient.tar.bz2 -C \
|
||||
/tmp/ddclient --strip-components=1 && \
|
||||
cp /tmp/ddclient/ddclient /usr/bin/ && \
|
||||
cp /defaults/ddclient.conf /ddclient.conf && \
|
||||
chmod 600 /ddclient.conf && \
|
||||
chown ddclient:ddclient /ddclient.conf && \
|
||||
|
||||
# add runtime folders and change permissions
|
||||
mkdir -p /var/cache/ddclient && \
|
||||
@ -53,10 +59,8 @@ RUN \
|
||||
build-dependencies && \
|
||||
rm -rf \
|
||||
/config/.cpanm \
|
||||
/root/.cpanm \
|
||||
/tmp/*
|
||||
|
||||
# copy local files
|
||||
COPY root/ /
|
||||
|
||||
# ports and volumes
|
||||
VOLUME /config
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
######################################################################
|
||||
daemon=300 # check every 300 seconds
|
||||
syslog=yes # log update msgs to syslog
|
||||
mail=root # mail all msgs to root
|
||||
mail-failure=root # mail failed update msgs to root
|
||||
#mail=root # mail all msgs to root
|
||||
#mail-failure=root # mail failed update msgs to root
|
||||
pid=/var/run/ddclient/ddclient.pid # record PID in file.
|
||||
ssl=yes # use ssl-support. Works with
|
||||
# ssl-library
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
|
||||
# copy default config if not present in /config
|
||||
[[ ! -e /config/ddclient.conf ]] && \
|
||||
cp /defaults/ddclient.conf /config
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
exec \
|
||||
s6-setuidgid ddclient /usr/bin/ddclient -foreground -file /config/ddclient.conf
|
||||
s6-setuidgid ddclient /usr/bin/ddclient -foreground -file /ddclient.conf
|
||||
@ -1,8 +1,10 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# starting inotify to watch /config/ddclient.conf and restart ddclient if changed.
|
||||
while inotifywait -e modify /config/ddclient.conf; do
|
||||
# kill "$(pgrep ddclient)"
|
||||
while inotifywait -e close_write /config/ddclient.conf; do
|
||||
cp /config/ddclient.conf /ddclient.conf
|
||||
chmod 600 /ddclient.conf
|
||||
chown ddclient:ddclient /ddclient.conf
|
||||
kill "$(cat /var/run/ddclient/ddclient.pid)"
|
||||
echo "ddclient have been restarted"
|
||||
done
|
||||
Loading…
x
Reference in New Issue
Block a user