Public | Automated Build

Last pushed: 9 months ago
Short Description
Install python3 mysql driver mysqlclient on alpine linux (just 101 MB).
Full Description


Install python3 mysql driver mysqlclient on alpine linux.


First, a mariadb container named my-mariadb is running.

>> docker ps 
d627912ec946    mariadb   "docker-entrypoint..."   6 days ago     Up 6 days>3306/tcp     my-mariadb

Run this mysqlclient driver linked with my-mariadb.

docker run -it --link my-mariadb:mysql py3-mysqlclient-alpine python

Python 3.6.1 (default, Jun 19 2017, 23:58:41)
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>> MySQLdb.connect(host="mysql", user="YOUR USER", passwd="YOUR PASSWORD", db="YOUR DATABASE NAME")
<_mysql.connection open to 'mysql' at 55f032a2bbb8>

In most cases, you will build your own image based on this.

Docker Pull Command
Source Repository