1. 拉取运行容器
本文通过拉取v2ray官方docker容器,创建v2ray服务容器;
mkdir -p /etc/v2ray
//宿主机创建配置文件,这里自己可以修改端口号,例如本文的36572
cat >> /etc/v2ray/config.json << EOF
{
"log" : {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbounds": [{
"port": 36572,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "cccccccc-8888-aaaa-dddd-c2223ae49153",
"level": 1,
"alterId": 64
}
]
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {}
}]
}
EOF
#拉取官方镜像,并将镜像存储于/var/lib/docker/image/overlay2/imagedb/content/sha256目录下,如无法删除镜像直接删文件即可
docker pull v2ray/official
#创建容器,指定名称v2ray
docker run -itd -p 36572:36572 -v /etc/v2ray:/etc/v2ray --name v2ray v2ray/official
2. 相关链接
-
目前已基本不采用v2ray,建议采用shadowsock
-
v2ray源码github地址:https://github.com/v2ray/v2ray-core.git
-
v2ray一键安装github地址:https://github.com/233boy/v2ray/tree/master