Sign inSign up

liyuleii/v2ray

By liyuleii

•Updated over 4 years ago

v2ray-x86和arm64版,带dockerfile

Image
0

356

liyuleii/v2ray repository overview

⁠原作者地址https://hub.docker.com/r/xfceshi/v2op⁠

⁠本镜像构建了v2ray-server,x86和arm64版

当然了,要构建其他版本也可使用下面的dockerfile,只需要进入v2ray-core官方库 https://github.com/v2fly/v2ray-core/releases⁠ 找到对应版本替换即可

⁠1、镜像说明

⁠dockerfile如下
FROM alpine:3.15.0
RUN apk add --no-cache --virtual .build-deps ca-certificates curl  \
    && curl -L -H "Cache-Control: no-cache" -o /v2ray.zip https://github.com/v2fly/v2ray-core/releases/download/v4.31.0/v2ray-linux-64.zip  \
    && mkdir /usr/bin/v2ray /etc/v2ray  \
    && touch /etc/v2ray/config.json  \
    && unzip /v2ray.zip -d /usr/bin/v2ray  \
    && rm -rf /v2ray.zip /usr/bin/v2ray/*.sig /usr/bin/v2ray/doc /usr/bin/v2ray/*.json /usr/bin/v2ray/*.dat /usr/bin/v2ray/sys*  \
    && chgrp -R 0 /etc/v2ray  \
    && chmod -R g+rwX /etc/v2ray
ADD config.json /etc/v2ray/config.json
ENTRYPOINT ["/usr/bin/v2ray/v2ray","-config=/etc/v2ray/config.json"]
EXPOSE 8081
⁠启动服务所需的config.json的配置文件如下
{
  "inbounds": [
  {
    "port": 8081,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "ba651c8c-cb35-4c46-bf6c-f90bd6f094e3",
          "alterId": 64
        }
      ]
    },
    "streamSettings": {
      "network": "ws",
      "wsSettings": {
        "path": "/v2ray"
      }
    }
  }
  ],
  "outbounds": [
  {
    "protocol": "freedom",
    "settings": {}
  }
  ]
}

⁠2、直接启动

###docker-compose启动文件docker-compose.yml

version: '3'
services:
  v2ray:
    image: liyuleii/v2ray:v4.31.0-amd64
    container_name: v2ray
    restart: unless-stopped
    volumes:
      - ./config.json:/etc/v2ray/config.json
      - /etc/localtime:/etc/localtime
    ports:
      - "8081:8081"

###使用openwrt的passWall客户端连接

节点备注:自定义
类型:v2ray
协议:Vmess
地址(支持域名):(外网ip)
端口:8081
加密方式:none
ID:ba651c8c-cb35-4c46-bf6c-f90bd6f094e3
额外ID(AlterID):64
TLS:不勾选
传输方式:WebSocket
WebSocket Host:空
WebSocket Path:/v2ray
mux:不勾选

⁠3、使用nginx+ssl加密方式

###docker-compose启动文件docker-compose.yml

version: '3'
services:
  v2ray:
    image: liyuleii/v2ray:v4.31.0-amd64
    container_name: v2ray
    restart: unless-stopped
    volumes:
      - ./config.json:/etc/v2ray/config.json
      - /etc/localtime:/etc/localtime
#    ports:
#      - "8081:8081"

  nginx:
    image: nginx:1.21.6-alpine
    container_name: nginx
    restart: always
    ports:
#      - 80:80
      - 443:443
    volumes:
      - ./ssl/:/etc/nginx/ca/
      - ./default.conf:/etc/nginx/conf.d/default.conf
      - /etc/localtime:/etc/localtime
    healthcheck:
      test: curl -f http://localhost:80
      interval: 1m30s
      timeout: 30s
      retries: 3

###nginx配置文件default.conf

server {
 #listen 80;
 #server_name _;
 listen 443 ssl;
 server_name www.google.com;
 ssl_certificate /etc/nginx/ca/ca.pem;
 ssl_certificate_key /etc/nginx/ca/key.pem;
 ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
 ssl_ciphers HIGH:!aNULL:!MD5;

 location /v2ray {
        proxy_redirect off;
        proxy_pass http://v2ray:8081/v2ray;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout 60s;
        proxy_read_timeout 86400s;
        proxy_send_timeout 60s;
    }

}

###使用openwrt的passWall客户端连接

节点备注:自定义
类型:v2ray
协议:Vmess
地址(支持域名):(域名)
端口:443
加密方式:none
ID:ba651c8c-cb35-4c46-bf6c-f90bd6f094e3
额外ID(AlterID):64
TLS:不勾选
传输方式:WebSocket
WebSocket Host:空
WebSocket Path:/v2ray
mux:不勾选

Tag summary

Content type

Image

Digest

Size

13.1 MB

Last updated

over 4 years ago

docker pull liyuleii/v2ray:v4.31.0-arm64