Skip to content

Commit

Permalink
Restore original Dockerfile as Dockerfile.release and use this for pu…
Browse files Browse the repository at this point in the history
…blic releases
  • Loading branch information
ndbroadbent committed Sep 28, 2020
1 parent 0c7040c commit 1a0e829
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,3 +11,4 @@ __pycache__
.idea
.coverage
htmlcov
icloudpd-latest-py2.py3-none-any.whl
20 changes: 20 additions & 0 deletions Dockerfile.release
@@ -0,0 +1,20 @@
FROM alpine:latest

RUN set -xe && \
apk add --no-cache python3 && \
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

ARG ICLOUDPD_VERSION
ADD icloudpd-latest-py2.py3-none-any.whl /tmp
RUN set -xe \
&& pip install /tmp/icloudpd-latest-py2.py3-none-any.whl \
&& icloudpd --version \
&& icloud -h | head -n1

RUN adduser -D -h /home/user -u 1000 user
USER user
3 changes: 2 additions & 1 deletion scripts/build_docker
Expand Up @@ -4,9 +4,10 @@ set -e
ICLOUDPD_VERSION="$(cat setup.py | grep version= | cut -d'"' -f 2)"
echo "Current icloudpd version: ${ICLOUDPD_VERSION}"

cp ./dist/icloudpd* ./icloudpd-latest-py2.py3-none-any.whl
docker build \
--build-arg "ICLOUDPD_VERSION=${ICLOUDPD_VERSION}" \
-t ndbroadbent/icloudpd \
-f Dockerfile.release \
.

docker push ndbroadbent/icloudpd

0 comments on commit 1a0e829

Please sign in to comment.