zoukankan      html  css  js  c++  java
  • Docker-compose常用命令

    1.github地址:https://github.com/TodorText/lnmp.git

    这个是根据laradock精简的lnmp,并且摘除了从容器挂载数据卷

    2.命令

    docker-compose --help你会看到如下这么多命令

     1 build               Build or rebuild services
     2 bundle              Generate a Docker bundle from the Compose file
     3 config              Validate and view the Compose file
     4 create              Create services
     5 down                Stop and remove containers, networks, images, and volumes
     6 events              Receive real time events from containers
     7 exec                Execute a command in a running container
     8 help                Get help on a command
     9 images              List images
    10 kill                Kill containers
    11 logs                View output from containers
    12 pause               Pause services
    13 port                Print the public port for a port binding
    14 ps                  List containers
    15 pull                Pull service images
    16 push                Push service images
    17 restart             Restart services
    18 rm                  Remove stopped containers
    19 run                 Run a one-off command
    20 scale               Set number of containers for a service
    21 start               Start services
    22 stop                Stop services
    23 top                 Display the running processes
    24 unpause             Unpause services
    25 up                  Create and start containers
    26 version             Show the Docker-Compose version information

    3.常用命令

    docker-compose up -d nginx                     构建建启动nignx容器

    docker-compose exec nginx bash            登录到nginx容器中

    docker-compose down                              删除所有nginx容器,镜像

    docker-compose ps                                   显示所有容器

    docker-compose restart nginx                   重新启动nginx容器

    docker-compose run --no-deps --rm php-fpm php -v  在php-fpm中不启动关联容器,并容器执行php -v 执行完成后删除容器

    docker-compose build nginx                     构建镜像 。        

    docker-compose build --no-cache nginx   不带缓存的构建。

    docker-compose logs  nginx                     查看nginx的日志 

    docker-compose logs -f nginx                   查看nginx的实时日志

    docker-compose config  -q                        验证(docker-compose.yml)文件配置,当配置正确时,不输出任何内容,当文件配置错误,输出错误信息。 

    docker-compose events --json nginx       以json的形式输出nginx的docker日志

    docker-compose pause nginx                 暂停nignx容器

    docker-compose unpause nginx             恢复ningx容器

    docker-compose rm nginx                       删除容器(删除前必须关闭容器)

    docker-compose stop nginx                    停止nignx容器

    docker-compose start nginx                    启动nignx容器

    分享促进成长
  • 相关阅读:
    _CrtSetBreakAlloc(…)来检测内存泄漏+VC使用CRT调试功能检测内存泄漏(转)
    VC 2005 解决方案的目录结构设置和管理
    ArcGIS Engine基础开发教程(转)
    vc++实现avi文件的操作 用于视频解析及录制(转)
    微软免费杀毒软件下周二公测 年底推简体中文版 狼人:
    大量用户升级iPhone3.0系统导致苹果服务器故障 狼人:
    苹果发布45个iPhone和iTouch漏洞补丁 狼人:
    “汉网热血三国”“南方电视台”等网站被挂马 狼人:
    WAPI有望晋身国际标准 最大阻力美国首度支持 狼人:
    前Google员工推云安全服务检测网站挂马 狼人:
  • 原文地址:https://www.cnblogs.com/hpzyang/p/15503064.html
Copyright © 2011-2022 走看看