Get the most out of your Centmin Mod LEMP stack
Become a Member

Docker Percona CentOS 6.6 + Percona 5.6 Docker Image

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

  1. eva2000

    eva2000 Administrator Staff Member

    30,981
    6,919
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,422
    Local Time:
    2:23 PM
    Nginx 1.13.x
    MariaDB 5.5
    Working Percona 5.6 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 from Docker Hub

    Code:
      docker pull centminmod/docker-centos66-percona56
    
    Run docker container

    Code:
      docker run -d -p 3306:3306 -t centminmod/docker-centos66-percona56
    
    or specify a name e.g. percona1

    Code:
      docker run --name percona1 -d -p 3306:3306 -t centminmod/docker-centos66-percona56
    
    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 percona1 -d -p 3307:3306 -t centminmod/docker-centos66-percona56
    
    to access container via bash if started with name = percona1

    Code:
      docker exec -ti percona1 /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 10 server hence the client is 10.0.16 to connect to Percona 5.6.22 docker container

    Code:
      mysqladmin -P 3307 -h 172.17.42.1 -u root -p ver
    Enter password: 
    mysqladmin  Ver 9.1 Distrib 10.0.16-MariaDB, for Linux on x86_64
    Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
    
    Server version          5.6.22-72.0
    Protocol version        10
    Connection              172.17.42.1 via TCP/IP
    TCP port                3307
    Uptime:                 25 sec
    
    Threads: 1  Questions: 2  Slow queries: 0  Opens: 67  Flush tables: 1  Open tables: 60  Queries per second avg: 0.080
    Building from Dockerfile
    
    Grab files

    Code:
      git clone https://github.com/centminmod/docker-centos66-percona56.git
    
    Build docker container with image name = centos66-percona56. Run command within same directory as Dockerfile

    Code:
      docker build -t centos66-percona56 .
    
    To run follow same run steps above.