Skip to content

Instantly share code, notes, and snippets.

@wolkenarchitekt
Last active March 21, 2018 09:45
Show Gist options
  • Save wolkenarchitekt/6c6c5926a290e87583174dde8df65f22 to your computer and use it in GitHub Desktop.
Save wolkenarchitekt/6c6c5926a290e87583174dde8df65f22 to your computer and use it in GitHub Desktop.
#
# Fetches latest MYSQL dump from radio-browser.info, converts it to SQLite.
# Usage:
# docker build -t radiobrowser-converter .
# docker run -v $PWD:/temp -it --rm radiobrowser-converter
#
FROM mysql:latest
RUN apt-get update
RUN apt-get install -y rubygems ruby-mysql2 wget build-essential libmysqlclient-dev ruby2*-dev sqlite3 libsqlite3-dev
RUN gem install sequel mysql2 sqlite3
RUN mkdir /temp
WORKDIR /temp
RUN wget http://www.radio-browser.info/backups/latest.sql.gz
CMD service mysql start && \
MYSQL_PWD=root mysql -uroot -e 'CREATE DATABASE stations;' && \
echo "Importing DB dump..." && \
gunzip -c latest.sql.gz | MYSQL_PWD=root mysql -uroot stations && \
sequel -C mysql2://root:root@localhost:3306/stations sqlite://radio.sqlite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment