操作步骤

  1. 快速进入容器

    了解docker的同学知道,经常需要进入容器中查看内容,配置进入容器命令。

    编辑 ~/.bashrc(或 ~/.zshrc),添加:

    alias dmysql='docker exec -it dnnmmp_mysql_1 /bin/bash'
    alias dredis='docker exec -it dnnmmp_redis_1 /bin/sh'
    alias dnginx='docker exec -it dnnmmp_nginx_1 /bin/sh'
    alias dmongodb='docker exec -it dnnmmp_mongodb_1 /bin/sh'
    alias dphp72='docker exec -it dnnmmp_php72_1 /bin/bash'
    
    1
    2
    3
    4
    5

    使生效:

    $source ~/.bashrc(或 ~/.zshrc)
    
    1
更新于: 8/23/2019, 4:01:34 PM