meele/xray

By meele

Updated 10 days ago

Xray-core Docker Image

Image
Networking

883

Xray-core Docker Image

About Xray-core

Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.

Xray-core Documentation

Others

If you need to install docker by yourself, follow the official installation guide⁠.

If you need to install Docker Compose by yourself,follow the official installation guide⁠.

For more information on docker and containerization technologies, refer to official document⁠.

eg.

Basic Usage

Install from the command line
docker pull meele/xray:latest

Create a configuration file config.json in the /etc/xray directory. The content is as follows:

{
  "inbounds": [{
    "port": 9000,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "meele"
        }
      ]
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  }]
}

Container Run

docker run -d -p 9000:9000 --name xraybc --restart=always -v /etc/xray:/etc/xray meele/xray --config /etc/xray/config.json

Advance

Directory structure example
xray_vless_reality/
├── config/
│   └── config.json
├── docker-compose.yml

Run using docker-compose

touch docker-compose.yml

version: '3.8'

services:
  xray:
    image: meele/xray:latest
    container_name: xray
    restart: unless-stopped
    ports:
      - "443:443"
      - "80:80"
    volumes:
      - ./config:/etc/xray
      - ./logs:/var/log/xray
    environment:
      - TZ=Asia/Shanghai
    command: ["-config", "/etc/xray/config.json"]

volumes:
  config:
  logs:

configuration

You need to create a file named config.json in the config directory to configure vless-vision-reality.

The following is an example configuration:

{
  "log": {
    "access": "/var/log/xray/access.log",
    "error": "/var/log/xray/error.log",
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "port": 443,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "id": "UUID",  
            "flow": "xtls-rprx-vision",
            "level": 0,
            "email": "example@example.com"
          }
        ],
        "decryption": "none"
      },
      "streamSettings": {
        "network": "tcp",
        "security": "reality",
        "realitySettings": {
          "show": true,
          "dest": "www.example.com:443",  
          "serverNames": [
            "www.example.com"  
          ],
          "privateKey": "PRIVATE_KEY",  
          "shortIds": [
            "short_id"  
          ]
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

Run the following command in the project directory to start Xray:

docker-compose up -d

Run the following command to view the running status of the container:

docker-compose ps

You can view the logs of the Xray container with the following command:

docker-compose logs -f xray

This way you can easily manage and deploy.

docker-compose down
docker-compose up -d

Docker Pull Command

docker pull meele/xray