V2Fly/V2ray Docker版官方搭建教程

V2Fly/V2ray Docker版官方搭建教程

1:Docker安装
CentOS系统

1
yum install -y docker

debian系统

1
2
3
apt-get install -y docker
curl -sSL https://get.docker.com | bash
service docker restart

2:拉取V2ray官方镜像

1
docker pull v2ray/official

3:在etc目录下创建V2ray文件夹

1
mkdir /etc/v2ray

4:进入V2ray文件夹并创建config.json配置文件

1
vi config.json

TCP+VMESS配置文件如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"dns": {},
"stats": {},
"inbounds": [
{
"port": 自定义端口,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "[UUID自定义](https://www.uuidgenerator.net/)",
"alterId": 32
}
]
},
"tag": "in-0",
"streamSettings": {
"network": "tcp",
"security": "none",
"tcpSettings": {}
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "blocked"
}
]
},
"policy": {},
"reverse": {},
"transport": {}
}

5:启动Docker容器

1
docker run -it -d --name v2ray -v /etc/v2ray:/etc/v2ray -p 8888:8888 v2ray/official v2ray -config=/etc/v2ray/config.json

6:容器列表查看

1
docker container ls

7:启动和停止V2ray

1
2
3
docker container start v2ray //启动V2ray
docker container stop v2ray //停止V2ray
docker container restart v2ray //重启V2ray

若要升级镜像请按如下命令操作:

1
2
3
4
docker container stop v2ray
docker container rm v2ray
docker pull v2ray/official
docker run -it -d --name v2ray -v /etc/v2ray:/etc/v2ray -p 8888:8888 v2ray/official v2ray -config=/etc/v2ray/config.json

END

TG交流群

支付宝收款签约

年付81元G口VPS

SiemensTutorials

VTURAY网络加速

亚马逊测评资源网|

美国住宅动态