1.github地址:https://github.com/TodorText/lnmp.gitphp
這個是根據laradock精簡的lnmp,而且摘除了從容器掛載數據卷nginx
2.命令git
docker-compose --help你會看到以下這麼多命令github
build Build or rebuild services bundle Generate a Docker bundle from the Compose file config Validate and view the Compose file create Create services down Stop and remove containers, networks, images, and volumes events Receive real time events from containers exec Execute a command in a running container help Get help on a command images List images kill Kill containers logs View output from containers pause Pause services port Print the public port for a port binding ps List containers pull Pull service images push Push service images restart Restart services rm Remove stopped containers run Run a one-off command scale Set number of containers for a service start Start services stop Stop services top Display the running processes unpause Unpause services up Create and start containers version Show the Docker-Compose version information
3.經常使用命令docker
docker-compose up -d nginx 構建建啓動nignx容器json
docker-compose exec nginx bash 登陸到nginx容器中緩存
docker-compose down 刪除全部nginx容器,鏡像bash
docker-compose ps 顯示全部容器php-fpm
docker-compose restart nginx 從新啓動nginx容器ui
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容器