MariaDB setup in Docker.
First you need to download Docker Image for APACHE
[root@rhel7 htdocs]# docker pull centos/mariadb-101-centos7
Using default tag: latest
Trying to pull repository docker.io/centos/mariadb-101-centos7 …
latest: Pulling from docker.io/centos/mariadb-101-centos7
[root@rhel7 htdocs]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/centos/mariadb-101-centos7 latest 0c8705984608 9 days ago 469.8 MB
Start contener from Docker image. Here i use port 3306 for host OS which will be redirect all request to port 3306 of contaner.
[root@rhel7 htdocs]# docker run -d –name mariadb_feenixdv -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 docker.io/centos/mariadb-101-centos7
d25ae29b815e436c56d41f0bc7ab0770d312d6c01995b10fd95ebe05835d215f
[root@rhel7 htdocs]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d25ae29b815e docker.io/centos/mariadb-101-centos7 "container-entrypoint" 11 seconds ago Up 2 seconds 0.0.0.0:3306->3306/tcp mariadb_feenixdv
Test:-
[root@rhel7 yum.repos.d]# mysql -u user -h 10.224.24.XX -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 16
Server version: 10.1.29-MariaDB MariaDB Server
Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>