Article Image
Image: docker
read

A few days ago it was time to do another transformation of SQL to RDF. This time my goal was to have a ETL script which has as few as possible dependencies and can be used out of the box without changing the system it runs on.

This is where docker enters the game. Thanks to process injection there is an easy way to load an SQL dump into a docker container:

Start a mysql instance

docker run --name dump -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql

This starts a docker container with name dump using the official MySQL docker image. It also makes the database available to the host on standard port 3306.

Load the SQL dump

docker exec -i dump mysql -uroot -proot < dump.sql

Et voilĂ : the dump is loaded! Note that the -i option allows to use input redirection from the host right into the docker container.

Blog Logo

Marvin Frommhold

"Aufgrund falschen Medienkonsums und Bildungsmangel gibt es in Deutschland immer mehr assipöse Menschen."

Image

depressiveRobot

random stuff by a linked data engineer

Back to Overview