Public Repository

Last pushed: 2 years ago
Short Description
SQLDeveloper container to link with data persistent MySQL or MariaDB container
Full Description

This image have been tested on CentOS7 with Docker 1.11.2

First, create a data persistent MySQL or MariaDB docker container :

$ docker run -d --net host --name <container-name> -v /data:/var/lib/mysql -e MYSQL_ALLOW_EMPTY_PASSWORD=true <mysql | mariadb>:latest

Note : the option --net host is very important otherwise it won't work (trust me).

Download MySQL Driver to be able to connect to DB

$ wget \
&& tar -C /data -zxf mysql-connector-java-5.1.39.tar.gz \
&& mv /data/mysql-connector-java-5.1.39/mysql-connector-java-5.1.39-bin.jar /data \
&& rm -rf /data/mysql-connector-java-5.1.39/

This command allows to download the driver, extract it, remove the original tar file and place the driver in the path /data which is the shared volume between the host, the mysql container and sqldev container.

Then create the container expected by all :

$ docker run -it --net=host -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v /data:/data -e DISPLAY -e TZ=GMT remycrt/sqldeveloper

Note : There is also the option --net host to link containers using it.

Once this last container launched, SQLDeveloper window opens.
If there's no MySQL tab in the new connection panel, path to the driver must be set.
According to this, click in the menu bar on Tools > Preferences...> Database > Third Party JDBC Drivers > Add Entry
Then select the jar file downloaded and extracted from tar file in step #2.

Happy dockering!

Docker Pull Command