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
  • 相关阅读:
    BZOJ 1001: [BeiJing2006]狼抓兔子
    BZOJ 1031: [JSOI2007]字符加密Cipher
    BZOJ 1083: [SCOI2005]繁忙的都市
    BZOJ 1034: [ZJOI2008]泡泡堂BNB
    BZOJ 1040: [ZJOI2008]骑士
    BZOJ 1026: [SCOI2009]windy数
    BZOJ 1022: [SHOI2008]小约翰的游戏John
    BZOJ 1018: [SHOI2008]堵塞的交通traffic
    BZOJ: 2819 Nim
    bzoj 3144
  • 原文地址:https://www.cnblogs.com/webclz/p/11908343.html
Copyright © 2011-2022 走看看