diff --git a/rsyncd/Dockerfile b/rsyncd/Dockerfile index bd9ef73..7c2abac 100644 --- a/rsyncd/Dockerfile +++ b/rsyncd/Dockerfile @@ -1,5 +1,9 @@ FROM alpine:3.16 -RUN apk add --no-cache rsync +COPY entrypoint.sh /entrypoint.sh -CMD ["/usr/bin/rsync", "--daemon", "--no-detach", "--config", "/etc/rsyncd.conf"] +RUN chmod +x /entrypoint.sh && \ + apk add --no-cache rsync + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["/usr/bin/rsync", "--daemon", "--no-detach", "--config", "/etc/rsyncd.conf", "--verbose"] diff --git a/rsyncd/Makefile b/rsyncd/Makefile index 3419c97..922119d 100644 --- a/rsyncd/Makefile +++ b/rsyncd/Makefile @@ -5,13 +5,13 @@ PLATFORMS=linux/amd64,linux/arm64 .PHONY: build push buildx -build: Dockerfile +build: Dockerfile entrypoint.sh docker build -t $(IMG) . push: build docker image push $(IMG) -buildx: Dockerfile +buildx: Dockerfile entrypoint.sh docker buildx build \ --platform $(PLATFORMS) \ --tag $(IMG) \ diff --git a/rsyncd/entrypoint.sh b/rsyncd/entrypoint.sh new file mode 100644 index 0000000..fc15f07 --- /dev/null +++ b/rsyncd/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ -n "$SECRETS" ]; then + echo "$SECRETS" > /etc/rsyncd.secrets + chmod 600 /etc/rsyncd.secrets +fi + +exec "$@"