Docker一键部署Clash服务与管理面板
启动容器:
XML/HTML代码
- docker run -d \
- --name clash \
- --restart=always \
- --log-opt max-size=1m \
- -v /opt/clash:/root/.config/clash \
- -p 7888:8080 -p 7890:7890 -p 7891:7891 \
- laoyutang/clash-and-dashboard:latest
-v /opt/clash/:/root/.config/clash/ 提供clash的yaml文件
-p 7888:8080 管理页面端口
-p 7890:7890 http代理端口 socks端口使用7891
laoyutang/clash-and-dashboard:latest 镜像
访问Ip:7888管理页面即可,注意非本机使用,请勾选允许局域网连接
自动更新yaml文件:
建议直接使用crontab启动定时任务每日更新,脚本可参考如下:
XML/HTML代码
- #!/bin/bash
- curl -o /opt/clash/config.yaml https://mirror.ghproxy.com/https://raw.githubusercontent.com/chengaopan/AutoMergePublicNodes/master/list.yml
- docker restart clash
XML/HTML代码
- curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15 ClashX/1.78.0" https://mirror.ghproxy.com/https://raw.githubusercontent.com/chengaopan/AutoMergePublicNodes/master/list.yml
XML/HTML代码
- #!/bin/bash
- curl -o /opt/clash/config.yaml -LvH 'User-Agent: clashx/1.78.0' https://mirror.ghproxy.com/https://raw.githubusercontent.com/chengaopan/AutoMergePublicNodes/master/list.yml
- docker restart clash
metacubexd-ui
clash-meta(新版本以改名):
docker pull metacubex/mihomo
docker pull metacubexd ghcr.io/metacubex/metacubexd