-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
27 lines (19 loc) · 994 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM alpine:3.9
ARG ICLOUDPD_VERSION
RUN set -xe && \
apk add --no-cache python3 tzdata && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --upgrade pip setuptools && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \
rm -r /root/.cache && \
pip install icloudpd==${ICLOUDPD_VERSION} && \
icloudpd --version && \
icloud -h | head -n1
RUN set -xe && \
echo -e "#!/bin/sh\nicloudpd /data --username \${USERNAME} --password \${PASSWORD} --size original --recent \${RECENT} --auto-delete" > /home/icloud.sh && \
chmod +x /home/icloud.sh && \
echo -e "#!/bin/sh\ncp /usr/share/zoneinfo/\${TZ} /etc/localtime\necho -e \"\${CRON} /home/icloud.sh\" > /home/icloud.crontab\n/usr/bin/crontab /home/icloud.crontab\n/usr/sbin/crond -f -l 8" > /home/entry.sh && \
chmod +x /home/entry.sh
CMD ["/home/entry.sh"]