4.docker application deployment

A .docker application deployment

1.MySQL deployment

(1) Requirements:

  MySQL Docker deployed in the container, and through the external client operating mysql MySQL 

(2) implemented steps of:

  1. Search MySQL Mirror:  Docker Search MySQL 

  2. Mirror Pull MySQL:  Docker pull MySQL: 5.6 

  3. Create a container:

    Mysql # Create directory / root directory for storing information data mysql 
    mkdir ~ / mysql 
    CD ~ / mysql
  4. Set up port mapping, mapping directory

    docker run -id \
    -p 3307:3306 \
    --name=c_mysql \
    -v $PWD/conf:/etc/mysql/conf.d \
    -v $PWD/logs:/logs \
    -v $PWD/data:/var/lib/mysql \
    -e MYSQL_ROOT_PASSWORD=123456 \
    mysql:5.6

    Parameter Description:

    • 3307 -p: 3306 : 3306 to map the host to a port of the container 3307 port.

    • $ PWD -v / conf: /etc/mysql/conf.d : the conf / my.cnf under the current directory is mounted to the host vessel /etc/mysql/my.cnf. Configuration directory

    • $ PWD -v / logs: / logs : the logs directory under the current directory is mounted to the host container / logs. Log Directory

    • $ the PWD -v / data: / var / lib / MySQL  : the master data directory under the current directory mounted to the container / var / lib / mysql. Data Directory

    • ** - e MYSQL_ROOT_PASSWORD = 123456: ** Initialization root password.

  5. Into the container, the operation MySQL:  Docker Exec Expediting IT c_mysql / bin / the bash 

  6. Using an external device connected to the container mysql

(3) MySQL deployment

(4) use centos7 server Ali cloud created if the configuration and installation docker containers SQLyog mysql connection problem appears 2003 is not configured Ali cloud security group

  • Reference URL: https: //yq.aliyun.com/articles/701181

  • I port is 3307, authorized access to the object 0.0.0.0/0

Landing on the computer Ali cloud operating results:

Landing on the phone Ali cloud operating results:

2.Tomcat deployment

3.Nginx deployment

4.Redis deployment

 

Guess you like

Origin www.cnblogs.com/zhihaospace/p/12359328.html