嚐嚐旺旺的冷麵:3 桶 8 元衝量狂促(日常 33.9 元)
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 services5 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 containers11 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 services18 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容器
分享促進成長