hbashton / spotify-ripper

https://github.com/jrnewell/spotify-ripper has been revived
MIT License
493 stars 98 forks source link

Adding Docker support #34

Open jonas-m- opened 6 years ago

jonas-m- commented 6 years ago

Added ability to build & run spotify-ripper in Docker, without the need of manual installation or resource-hungry VMs

The resulting image is based on the official python:3.5-slim image and is 268MB in size

ultrafez commented 5 years ago

I know this is an old PR, but I tried out your fork branch and had a couple of issues which I've found solutions to.

The python:3.5-slim image is now based on Debian Stretch, so jessie in the deb source line needs to be replaced with stretch.

Also, Spotify no longer host the download for libspotify, but the Mopidy GitHub project have an archive containing the same files so I've replaced the wget path to pull from GitHub instead.

This is the updated command I'm using with those two changed lines:

echo 'deb http://deb.debian.org/debian stretch main non-free' > /etc/apt/sources.list \
    && apt-get -q update \
    && BUILD_PACKAGES='wget build-essential libffi-dev libfdk-aac-dev automake autoconf' \
    && apt-get install -qy --force-yes $BUILD_PACKAGES lame flac faac libav-tools vorbis-tools opus-tools \
    && wget https://github.com/nu774/fdkaac/archive/v0.6.3.tar.gz \
        && tar xvf v0.6.3.tar.gz \
        && cd fdkaac-0.6.3 \
        && autoreconf -i \
        && ./configure \
        && make install \
        && cd .. \
    && ARCHIVE=libspotify-12.1.51-Linux-$(uname -m)-release \
    && wget -O ${ARCHIVE}.tar.gz https://github.com/mopidy/libspotify-archive/blob/master/${ARCHIVE}.tar.gz?raw=true \
        && tar xvf ${ARCHIVE}.tar.gz \
        && cd ${ARCHIVE}/ \
        && make install prefix=/usr/local \
        && cd .. \
        && python setup.py install \
    && apt-get remove --purge -qy --force-yes $BUILD_PACKAGES \
    && apt-get autoremove -qy --force-yes \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /tmp/*

I haven't verified that the container still works beyond this, but I wanted to share my progress.

jonas-m- commented 5 years ago

Very nice, thanks! Will try to test it myself this weekend

jonas-m- commented 5 years ago

@ultrafez Tested - works as expected, so I've updated my pull request and additionally updated base image to include Debian distro version, as image build depends on stretch now

Thanks again! :)