zoukankan      html  css  js  c++  java
  • docker初探

    系统win10

    安装步骤参考菜鸟教程

    配置lnmp环境使用的镜像 https://hub.docker.com/r/2233466866/lnmp

    启动(Start)

    # 端口映射自行指定,容器名称自行指定为lnmp
    # Port mapping and container name can be specified by yourself
    docker run -d -i -t -p 81:80 -p 444:443 -p 3307:3306 -v /sys/fs/cgroup:/sys/fs/cgroup:ro --name=lnmp --privileged=true 2233466866/lnmp  

    连接(Connect)

    # 容器名称与上一步保持一致
    # Container name is consistent with the previous step
    docker exec -i -t lnmp /bin/bash

    状态(Status)

    ps aux|grep nginx
    ps aux|grep mysql
    ps aux|grep php-fpm
    # 或者(Or)
    systemctl status nginx
    systemctl status mysqld
    systemctl status php7

    密码(Password)

    # MySQL password
    cat /root/README.MD

    测试(Test)

    # 访问(Access)
    http://[ip]:81/index.php
    http://[ip]:81/index.html
    # 不要忘了防火墙设置的规则
    # Don't forget the rules of firewall settings

    警告(Warning)

    # 请及时修改Mysql的密码
    # Please change the password of MySQL in time
    # 请保持清醒头脑,明确自己是在容器内还是在服务器本身执行命令,以免造成不可挽回的损失
    # Please keep clear mind whether you execute the command in the container or in the server itself, so as to avoid irreparable loss

    配置(Config)

    #配置文件路径(Config file path)
    # Nginx
    /usr/local/nginx/conf/nginx.conf
    # MySQL
    /etc/my.cnf
    # PHP
    /usr/local/php7/lib/php.ini
    /usr/local/php7/etc/php-fpm.conf
    /usr/local/php7/etc/php-fpm.d/www.conf

    PHP扩展(PHP extension)

    # 默认已安装部分扩展在目录:/usr/local/php7/lib/php/extensions/no-debug-non-zts-20170718/
    # 如果要启用指定扩展,则需要修改php.ini,加上
    extension=xxx.so
    # xxx为PHP扩展的文件名,然后重启php
    systemctl restart php7

    其它基础命令

    docker ps //列出活跃的容器
    docker ps -a //列出所有的容器
    docker stop id //停止容器
    docker rm id //删除容器
    
    
    //上面的只是对容器操作的,不会对镜像产生影响

    坑1:windows启启动时候,盘符的处理如下,所有盘符都是可以同步的,前提是加入settings的share-drives

    docker run -d -i -t -p 80:80 -p 443:443 -p 3306:3306 -v /c/Users/13009/project:/www --name=lnmp --privileged=true 2233466866/lnmp
  • 相关阅读:
    linux常用命令
    mysql 开发基础系列20 事务控制和锁定语句(上)
    sql server 性能调优之 资源等待 CXPACKET
    mysql 开发基础系列19 触发器
    mysql 开发基础系列18 存储过程和函数(下)
    mysql 开发基础系列17 存储过程和函数(上)
    sql server 性能调优之 资源等待PAGEIOLATCH
    mysql 开发基础系列16 视图
    mysql 开发基础系列15 索引的设计和使用
    sql server 性能调优之 当前用户请求分析 (1)
  • 原文地址:https://www.cnblogs.com/webclz/p/11908343.html
Copyright © 2011-2022 走看看