树莓派使用Docker搭建speedTest服务端

需求环境

树莓派安装linux系统,已经安装好了docker,树莓派最好有千兆网口,推荐使用树莓派4B,系统使用 树莓派爱好者社区的,内置docker
链接: https://github.com/openfans-community-offical/Debian-Pi-Aarch64.

搭建

1、拉取镜像

root@raspbian:~# docker pull 292427558/speedtest 
Using default tag: latest
latest: Pulling from 292427558/speedtest
Digest: sha256:f17c7a1b0c5ac88850d62495d5ff75301dcd31a8be64269cf2b9ad6f8d9661b1
Status: Downloaded newer image for 292427558/speedtest:latest
docker.io/292427558/speedtest:latest
root@raspbian:~# 

此镜像为根据librespeed/speedtest编译,原作者没有提供arm64的docker镜像

链接: https://github.com/librespeed/speedtest/tree/docker.

更多使用参数请参考

链接: https://github.com/librespeed/speedtest/blob/docker/doc.md.

2、启动容器
对外端口可以根据自己需要修改

root@raspbian:~# docker run -e MODE=standalone -p 80:80 -it --name speedtest 292427558/speedtest
+ rm -rf '/var/www/html/*'
+ cp /speedtest/speedtest.js /speedtest/speedtest_worker.js /var/www/html/
+ '[' standalone == standalone ']'
+ cp -r /speedtest/backend/ /var/www/html/backend
+ '[' '!' -z '' ']'
+ '[' standalone == backend ']'
+ '[' standalone == frontend ']'
+ '[' standalone == standalone ']'
+ cp /speedtest/standalone.php /var/www/html/index.php
+ [[ false == \t\r\u\e ]]
+ echo 'Done, Starting APACHE'
Done, Starting APACHE
+ apache2-foreground
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
[Mon Mar 23 08:57:50.961114 2020] [mpm_prefork:notice] [pid 11] AH00163: Apache/2.4.38 (Debian) PHP/7.2.28 configured -- resuming normal operations
[Mon Mar 23 08:57:50.961251 2020] [core:notice] [pid 11] AH00094: Command line: 'apache2 -D FOREGROUND'

3、测试
启动成功后 可以在浏览器访问树莓派的地址试试,我的地址为
http://192.168.50.200/
注意:若端口不为80 需添加端口号,比如为8080端口
如:http://192.168.50.200:8080/
在这里插入图片描述
点击start就可以测速了。
以下为我的电脑的局域网传输速度,基本跑满千兆了。同理可以在移动设备上测试wifi的最大传输速度,就可以了解局域网的一些性能瓶颈了。这就不展示了。
在这里插入图片描述
4、启动容器的一些命令
speedTest第一次运行为交互模式启动,可以 Ctrl + c 结束运行
启动
root@raspbian:~# docker start speedtest
停止
root@raspbian:~# docker stop speedtest

若大家觉得好用 麻烦大家去点个星星!!!
仓库地址
链接: https://hub.docker.com/repository/docker/292427558/speedtest.

源代码作者
链接: https://github.com/librespeed/speedtest.

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值