Docker部署Joggle客户端
bullet客户端已经提交到dockerhub仓库,可通过仓库拉去镜像也可自己通过Dockerfile生成镜像。 镜像默认支持的linux、mac,所以如果您使用windows 那么建议您使用官网的下载中心的windows版本。
https://hub.docker.com/repository/docker/wuweiit/bullet-client
支持 Architecture: amd64, 386, arm64, arm
linxu/Mac 快速使用docker体验bulletClient
在安装好docker容器环境的机器上执行下面创建容器的命令
docker run -d --name=bullet-client \
wuweiit/bullet-client
注意运行后的日志,会生成设备编码,编码需要记录下来绑定到账号下,才能控制客户端。
启动日志:
Bullet当前工作目录: /opt/bullet
Bullet配置文件目录: /opt/bullet/conf
:/opt/bullet/lib
continue...
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.2.4.RELEASE)
[2020-08-13 13:18:40,489]-com.wuweibi.bullet.client.ClientApplication-INFO [main] | Starting ClientApplication v1.0-SNAPSHOT on 4879419265fb with PID 1 (/opt/bullet/lib/bullet-client.jar started by root in /opt/bullet)
[2020-08-13 13:18:40,494]-com.wuweibi.bullet.client.ClientApplication-DEBUG [main] | Running with Spring Boot v2.2.4.RELEASE, Spring v5.2.3.RELEASE
[2020-08-13 13:18:40,494]-com.wuweibi.bullet.client.ClientApplication-INFO [main] | The following profiles are active: prod
[2020-08-13 13:18:41,904]-com.wuweibi.bullet.client.ClientApplication-INFO [main] | Started ClientApplication in 3.008 seconds (JVM running for 4.538)
[2020-08-13 13:18:42,035]-com.wuweibi.bullet.client.utils.ConfigUtils-DEBUG [main] | 准备初始化配置资源...
[2020-08-13 13:18:42,037]-com.wuweibi.bullet.client.utils.ConfigUtils-INFO [main] | 正在加载配置文件
[2020-08-13 13:18:42,053]-com.wuweibi.bullet.client.utils.ConfigUtils-DEBUG [main] | {
"deviceNo":"e6460ae9ba154d65a26c550d6266c801",
"logService":true,
"tunnel":"ws://joggle.cn:8081/tunnel"
}
[2020-08-13 13:18:42,272]-com.wuweibi.bullet.client.utils.ConfigUtils-DEBUG [main] | 读取到环境变量,不采用配置 env deviceNo=0000000000
[2020-08-13 13:18:42,272]-com.wuweibi.bullet.client.Connection-INFO [main] | websocket to ws://joggle.cn:8081/tunnel/0000000000
[2020-08-13 13:18:43,378]-com.wuweibi.bullet.client.BulletClient-DEBUG [Grizzly(1)] | Connected to endpoint(f351e744-ea60-4348-a2e3-49b0d256220e): conn successs
widnows方式未获取到网卡地址
[2020-08-13 13:18:48,409]-com.wuweibi.bullet.client.threads.BindIPThread-INFO [Thread-2] | Connection Bind ip=172.17.0.2
[2020-08-13 13:18:48,410]-com.wuweibi.bullet.client.threads.BindIPThread-INFO [Thread-2] | Connection Bind mac=02-42-ac-11-00-02
[2020-08-13 13:18:48,415]-com.wuweibi.bullet.protocol.MsgBindIP-DEBUG [Thread-2] | send MsgBindIP(ip=172.17.0.2, mac=02-42-ac-11-00-02)
[2020-08-13 13:18:53,382]-com.wuweibi.bullet.client.threads.HeartThread-INFO [Timer-0] | Connection heart time=2020-08-13 13:18:53
[2020-08-13 13:19:03,382]-com.wuweibi.bullet.client.threads.HeartThread-INFO [Timer-0] | Connection heart time=2020-08-13 13:19:03
================================================
================ Device NO =====================
=== 5s4jmygyox6o ===
================================================
自行构建镜像(需要有Dockerfile基础)
- 1、首先使用mvn打包bullet-client.jar,拷贝到lib目录中。
2、构建Docker镜像。
docker build \ --build-arg VERSION=0.0.1 \ -t wuweiit/bullet-client:0.0.1 .
3、快速运行Bullet客户端容器
docker run --rm --name=bullet-client \
wuweiit/bullet-client:0.0.1
- 4、将Bullet配置文件映射出来,自定义配置。
docker run --name=bullet-client \
-v /opt/bullet/conf/ngrok.yml:/opt/bullet/conf/ngrok.yml \
wuweiit/bullet-client:0.0.1