使用
This commit is contained in:
parent
1b0de4b3e3
commit
2ab67e5038
40
README.md
40
README.md
@ -0,0 +1,40 @@
|
||||
## docker 安装
|
||||
### windows & mac
|
||||
直接安装docker桌面客户端,win10可以先安装wsl2再安装docker桌面客户端, 19年的时候我用过win10安装docker桌面客户端,可以不需要wsl但必须启动虚拟机服务!不过这边建议使用wsl2,因为比虚拟机体验更好!
|
||||
|
||||
安装教程参考
|
||||
|
||||
1. [docker for win 安装](https://www.runoob.com/docker/windows-docker-install.html)
|
||||
2. [wsl2安装教程](https://learn.microsoft.com/zh-cn/windows/wsl/install)
|
||||
|
||||
|
||||
## 使用
|
||||
|
||||
```
|
||||
# 进入需要构建目标镜像目录比如:
|
||||
cd php8.1-swoole-alpine
|
||||
|
||||
# 构建镜像命令
|
||||
|
||||
docker build -t [自定义镜像名称] .
|
||||
|
||||
# 生成容器 指定容器名称
|
||||
|
||||
docker run --name="php_swoole_runtime" [镜像名称]
|
||||
|
||||
# 进入容器
|
||||
|
||||
docker exec -it [容器名称] /bin/sh
|
||||
|
||||
|
||||
# composer加速
|
||||
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
|
||||
|
||||
# 安装hyperf
|
||||
composer create-project hyperf/hyperf-skeleton
|
||||
|
||||
```
|
||||
|
||||
|
||||
## 命令参考
|
||||
[docker run 命令参考](https://www.runoob.com/docker/docker-run-command.html)
|
Loading…
x
Reference in New Issue
Block a user