docker搭建clash服务
centos8安装docker 和 docker-compose
cd /etc/yum.repos.d/
wget https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io
docker --version
systemctl status docker
systemctl enable docker
systemctl start docker
cd ~/
wget -O /usr/bin/docker-compose https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64
chmod a+x /usr/bin/docker-compose登录自己喜欢的clash服务平台,下载clash配置文件
局域网使用别忘记把config.yaml中的这个开关打开
allow-lan: truedocker-compose.yaml
version: '3'
services:
clash:
image: dreamacro/clash
volumes:
- ./config.yaml:/root/.config/clash/config.yaml
ports:
- "9090:9090"
- "7890:7890"
- "7891:7891"
# If you need external controller, you can export this port.
# - "8080:8080"
restart: always
# When your system is Linux, you can use `network_mode: "host"` directly.
# network_mode: "bridge"
container_name: clash
clashui:
image: haishanh/yacd
ports:
- "1234:80"
restart: always
# network_mode: "bridge"
container_name: classuiconfig.yaml和docker-compose.yml文件放在一个目录中,执行如入命令
sudo docker-compose up -d修改了配置文件,重启容器
sudo docker-compose restart访问UI面板(局域网中,12是虚拟机IP)
http://192.168.10.12:1234
添加接口地址 192.168.10.12:9090
选择好节点后,浏览器用192.168.10.12:7890 即可上网
版权属于:Joyber
本文链接:https://blog.qqvbc.com/default/481.html
转载时须注明出处及本声明