docker-git-puller/Dockerfile

20 lines
537 B
Docker

FROM alpine
LABEL org.opencontainers.image.authors="bluefox@privacynerd.de"
WORKDIR /
RUN apk update --no-cache && \
apk add --no-cache git && \
adduser -g cronuser -s /bin/sh -H -D cronuser && \
mkdir crond logs && \
touch logs/crond.log logs/puller.log && \
chown cronuser logs -R && \
echo $'#!/bin/sh\ncd /to-pull && git pull' > puller.sh && \
echo $'* * * * * cronuser /puller.sh\n' > crond/cronuser && \
chmod +x puller.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["crond", "-f", "-c", "crond"]