Want more timely Centmin Mod News Updates?
Become a Member

Docker MariaDB CentOS 6.6 + MariaDB 10.x Docker Image

Discussion in 'Centmin Mod Docker Development' started by eva2000, Feb 21, 2015.

  1. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    6:43 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Working MariaDB 10.x Docker image for CentOS 6.6 :)

    Default MySQL root user password



    The default MySQL root user password is set to = mysqlpass with added replication user = repl

    Grab the docker image from my repository


    Code:
    docker pull centminmod/docker-centos66-mariadb10
    
    Run docker container
    Code:
    docker run -d -p 3306:3306 -t centminmod/docker-centos66-mariadb10
    
    or specify a name e.g. mdb1
    Code:
    docker run --name mdb1 -d -p 3306:3306 -t centminmod/docker-centos66-mariadb10
    
    or if host system already has MySQL running on port 3306 need to map to another local host port e.g. 3307
    Code:
    docker run --name mdb1 -d -p 3307:3306 -t centminmod/docker-centos66-mariadb10
    
    to access container via bash if started with name = mdb1
    Code:
    docker exec -ti mdb1 /bin/bash
    
    to connect from host system to MariaDB docker container use the -h IP address which is shown for the docker0 network interface
    Code:
    ifconfig docker0 | grep 'inet '
    inet addr:172.17.42.1  Bcast:0.0.0.0  Mask:255.255.0.0
    
    e.g. host system running CentminMod.com LEMP stack MariaDB 5.5 server hence the client is 5.5.42 to connect to MariaDB 10.0.16 docker container
    Code:
    mysqladmin -P 3307 -h 172.17.42.1 -u root -p ver
    Enter password:
    mysqladmin  Ver 9.0 Distrib 5.5.42-MariaDB, for Linux on x86_64
    Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
    
    Server version          10.0.16-MariaDB
    Protocol version        10
    Connection              172.17.42.1 via TCP/IP
    TCP port                3307
    Uptime:                 1 min 2 sec
    
    Threads: 1  Questions: 1  Slow queries: 0  Opens: 0  Flush tables: 1  Open tables: 63  Queries per second avg: 0.016
    

    Building from Dockerfile




    Grab files
    Code:
    git clone https://github.com/centminmod/docker-centos66-mariadb10.git
    
    Build docker container with image name = centos66-mariadb10. Run command within same directory as Dockerfile
    Code:
    docker build -t centos66-mariadb10 .
    
    To run follow same run steps above.
     
    Last edited: Feb 23, 2015
  2. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    6:43 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Initial MariaDB docker build was built without supervisord, so if you go into container and do mysql restart service, you will prematurely end and exit from the MariaDB docker container. Next build will look at supervisord :)
     
  3. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    6:43 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+