clash docker

Last updated on November 22, 2024 pm

🧙 Questions

使用docker安装clash,并实现linux的http代理

☄️ Ideas

前提

下载订阅链接

自己找

wget --no-check-certificate -O ./config.yaml https://api.touhou.center/link/xxxx?clash=1
编写docker-compose脚本
vim docker-compose.yml

web 访问端口30211

version: '3'
services:
  clash:
    image: dreamacro/clash-premium
    container_name: clash
    volumes:
      - ./config.yaml:/root/.config/clash/config.yaml
    ports:
      - "7890:7890"
      - "9090:9090"
    restart: unless-stopped
    networks:
      - default
  svc-clash-dashboard:
    image: centralx/clash-dashboard
    container_name: clash-dashboard
    ports:
      - "30211:80"
    restart: always
    networks:
      - default

networks:
  default:
    driver: bridge
设置访问端口号
vim ./config.yaml
# 默认端口 7890
mixed-port: 7890
allow-lan: true
# 默认端口号 9090
external-controller: '0.0.0.0:9090'
secret: 'ispong123'
#一定要注释掉下面这一行
#routing-mark: 6666
启动镜像

停止 : docker-compose stop
删除 : docker-compose rm -v -f

sudo yum install -y docker-compose
sudo docker-compose up -d
sudo docker-compose logs -f
使用clash web ui

也可以使用官网的ui http://clash.razord.top/#/settings

20220922142631

选择方式

20220922155905

如果连不上可以选择全局模式

20221107105019

测试节点

20220922155851

选择节点

20220922155932

配置本地

一定要耐心等待,首次配置有点慢
注意: 此处代理为http协议代理,外网ping不通,只可以通过http协议访问外网

sudo vim /etc/profile
export https_proxy=isxcode:7890
export http_proxy=isxcode:7890
source /etc/profile

clash docker
https://ispong.isxcode.com/os/clash/clash docker/
Author
ispong
Posted on
August 23, 2022
Licensed under