//运行compose-yml文件
docker-compose up -d
//构建镜像
docker build -t allovince/php-helloworld .
//运行容器
docker run -d -p 8080:8080 allovince/php-helloworld
//查看容器信息
docker inspect 6d1fdcc958bf
//重启容器
docker restart 容器ID或容器名
//关闭
docker kill 容器ID或容器名
//进入容器
docker attach 容器ID或容器名
docker exec -it 容器ID或容器名 /bin/bash
RPC服务
// 启动服务
php bin/swoft rpc:start
// 守护进程启动
php bin/swoft rpc:start -d
// 重启
php bin/swoft rpc:restart
// 重新加载
php bin/swoft rpc:reload
// 关闭服务
php bin/swoft rpc:stop
HTTP服务
// 启动服务
php bin/swoft http:start
// 守护进程启动
php bin/swoft http:start -d
// 重启
php bin/swoft http:restart
netstat -ntlp //查看当前所有tcp端口
netstat -ntulp | grep 80 //查看所有80端口使用情况
netstat -ntulp | grep 3306 //查看所有3306端口使用情况
// 重新加载
php bin/swoft http:reload
// 关闭服务
php bin/swoft http:stop
//容器间访问
docker run -d --name dc098260cd0f --link bff13ac1a7fc swoft/swoft
//创建consul容器
docker run -d --name consul -p 8500:8500 consul
docker inspect --format '{{ .NetworkSettings.IPAddress }}' consul //获取ip地址
//下载组件
apt-get install -y 组件名