- 克隆仓库到本地
git clone git@github.com:kevin2li/clash_docker.git
- 进入仓库目录:
cd clash_docker
- 替换
clash_config.yaml
为自己的代理配置文件 - 启动容器
docker build . -t kevin2li/clash
docker compose up -d
- 选择代理
- 方法一:使用webUI
访问 http://clash.razord.top/#/proxies 进行连接设置 - 方法二:使用clashcli(推荐)
详见:https://github.com/shunf4/clashcli
# 测试延迟
docker exec -it clash ./clashcli -t
# 选择节点
docker exec -it clash ./clashcli
- 宿主机终端科学上网
export https_proxy="http://127.0.0.1:7890" && export http_proxy="http://127.0.0.1:7890"
- 测试
curl https://www.google.com