From 7e5ded3c013b6226ccbb14d3772a76602335869c Mon Sep 17 00:00:00 2001 From: Nick Stokoe Date: Mon, 15 Feb 2021 00:11:05 +0000 Subject: [PATCH] Dockerfile - use recent alpine Upgrade python package names to v3 versions. Drop jfloff/alpine-python, it seems to get us two versions of python which don't play together. Don't upgrade pip - seems to cause problems with building Add in all the prereqs, notably for building py3-cryptography, which needs a bleedin' rust toolchain --- Dockerfile | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index ec726e5..da83d5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,44 @@ +ARG alpine_version=3.13 + +FROM alpine:$alpine_version +# retrive alpine_version from before FROM +ARG alpine_version + ARG PUID=1000 ARG PGID=1000 +# This is an archive and isn't updated any more +ARG spotify_version=12.1.51-Linux-x86_64 -FROM jfloff/alpine-python:2.7 -ENV PYTHONPATH="/usr/local/lib/python2.7/site-packages:/usr/lib/python2.7/site-packages" +#ENV PYTHONPATH="/usr/local/lib/python$python_version/site-packages:/usr/lib/python$python_version/site-packages" WORKDIR /mopidy RUN \ echo "* Updating Package Repositories" \ - && echo 'http://dl-cdn.alpinelinux.org/alpine/v3.9/main' >> /etc/apk/repositories \ - && echo 'http://dl-cdn.alpinelinux.org/alpine/v3.9/community' >> /etc/apk/repositories \ + && echo "http://dl-cdn.alpinelinux.org/alpine/v${alpine_version}/main" >> /etc/apk/repositories \ + && echo "http://dl-cdn.alpinelinux.org/alpine/v${alpine_version}/community" >> /etc/apk/repositories \ && apk upgrade --no-cache \ - && pip install --upgrade pip \ && echo "* Installing Runtime Packages" \ && apk add -U --no-cache \ coreutils \ + build-base \ + rust \ + cargo \ su-exec \ libxml2-dev \ libxslt-dev \ libffi-dev \ openssl-dev \ - python2-dev \ + python3-dev \ + py3-pip \ + py3-wheel \ libcdio \ libcaca \ libvpx \ v4l-utils-libs \ - py2-crypto \ - py2-gst \ - py-gobject \ + py3-crypto \ + py3-gst \ + py3-gobject3 \ mailcap \ icecast \ gstreamer \ @@ -35,14 +46,14 @@ RUN \ gst-plugins-base \ gst-plugins-good \ gst-plugins-ugly \ - && pip install -U \ + && pip3 install -U \ pyopenssl \ youtube-dl \ pyasn1 \ - && wget -c https://mopidy.github.io/libspotify-archive/libspotify-12.1.51-Linux-x86_64-release.tar.gz -O - | tar -xzC /tmp \ - && make install -C /tmp/libspotify-12.1.51-Linux-x86_64-release prefix=/usr/local || true \ + && wget -c https://mopidy.github.io/libspotify-archive/libspotify-${spotify_version}-release.tar.gz -O - | tar -xzC /tmp \ + && make install -C /tmp/libspotify-${spotify_version}-release prefix=/usr/local || true \ && echo "* Installing Mopidy + Extensions" \ - && pip install -U \ + && pip3 install -U \ Mopidy \ Mopidy-Iris \ Mopidy-Spotify-Web \ @@ -53,7 +64,7 @@ RUN \ && echo "* Creating Mopidy User" \ && addgroup -g ${PGID} mopidy \ && adduser -h /mopidy -s /bin/sh -D -G mopidy -u $PUID mopidy \ - && echo "mopidy ALL=NOPASSWD: /usr/local/lib/pyenv/versions/2.7.16/lib/python2.7/site-packages/mopidy_iris/system.sh" >> /etc/sudoers \ + && echo "mopidy ALL=NOPASSWD: /usr/local/lib/pyenv/versions/*/lib/python*/site-packages/mopidy_iris/system.sh" >> /etc/sudoers \ && echo "* Cleaning up" \ && rm -rf /var/cache/apk/* \ && rm -rf /tmp/* \