rsyncd: secrets file is set up by entrypoint script

main
Ricard Illa 2022-09-16 12:12:02 +02:00
parent 52991f937a
commit ddb0c180d9
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
3 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,9 @@
FROM alpine:3.16 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"]

View File

@ -5,13 +5,13 @@ PLATFORMS=linux/amd64,linux/arm64
.PHONY: build push buildx .PHONY: build push buildx
build: Dockerfile build: Dockerfile entrypoint.sh
docker build -t $(IMG) . docker build -t $(IMG) .
push: build push: build
docker image push $(IMG) docker image push $(IMG)
buildx: Dockerfile buildx: Dockerfile entrypoint.sh
docker buildx build \ docker buildx build \
--platform $(PLATFORMS) \ --platform $(PLATFORMS) \
--tag $(IMG) \ --tag $(IMG) \

8
rsyncd/entrypoint.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
if [ -n "$SECRETS" ]; then
echo "$SECRETS" > /etc/rsyncd.secrets
chmod 600 /etc/rsyncd.secrets
fi
exec "$@"