Docker image: v2raya_core cannot find LoyalsoldierSite.dat without XRAY_LOCATION_ASSET
Description
When using the latest Docker image with the bundled v2raya_core, v2rayA reports that geoip.dat, geosite.dat, or v2raya_core may not be installed correctly.
I found that the actual issue is that v2raya_core cannot locate LoyalsoldierSite.dat unless XRAY_LOCATION_ASSET is explicitly set.
Environment
- v2rayA Docker image:
mzz2017/v2raya:latest - v2raya_core:
2.5.7 (based on xray-core 26.7.28) - Host: Synology DSM 7.x
- Architecture: x86_64
- Docker network mode:
host
Official Docker command
I initially followed the official Docker installation method:
docker run -d --restart=always --privileged --network=host --name v2raya \
-e V2RAYA_LOG_FILE=/tmp/v2raya.log \
-v /lib/modules:/lib/modules:ro \
-v /etc/resolv.conf:/etc/resolv.conf \
-v /etc/v2raya:/etc/v2raya \
ghcr.io/v2raya/v2rayaWhat I found
The geo files are present inside the container:
/usr/share/v2raya/
├── LoyalsoldierSite.dat
├── geoip.dat
└── geosite.datThe bundled core is also present and executable:
/usr/bin/v2raya_core
V2RAYA_CORE 2.5.7 (based on xray-core 26.7.28)However, running the core directly with the generated configuration fails:
/usr/bin/v2raya_core run --config=/etc/v2raya/config.jsonwith:
Failed to start: main: failed to load config files:
[/etc/v2raya/config.json]
> infra/conf: failed to build routing configuration
> infra/conf: invalid field rule
> common/geodata: illegal domain rule: ext:LoyalsoldierSite.dat:gfw
> common/geodata: failed to open LoyalsoldierSite.dat
> stat /usr/bin/LoyalsoldierSite.dat: no such file or directoryThis is unexpected because the file actually exists at:
/usr/share/v2raya/LoyalsoldierSite.datWorkaround
If I explicitly set:
XRAY_LOCATION_ASSET=/usr/share/v2rayathen the same command successfully loads the configuration:
XRAY_LOCATION_ASSET=/usr/share/v2raya \
/usr/bin/v2raya_core run --config=/etc/v2raya/config.jsonThe previous LoyalsoldierSite.dat error disappears and the core proceeds to start normally.
The same workaround in Docker Compose is:
environment:
- V2RAYA_V2RAY_BIN=/usr/bin/v2raya_core
- XRAY_LOCATION_ASSET=/usr/share/v2raya
- V2RAYA_LOG_FILE=/tmp/v2raya.logAfter adding XRAY_LOCATION_ASSET=/usr/share/v2raya and recreating the container, the v2rayA web UI no longer shows the warning about geoip.dat, geosite.dat, or v2raya_core.
Expected behavior
The official Docker image should either:
- Automatically configure the bundled
v2raya_coreto use the directory containing its bundled.dat_
Source: v2rayA/v2rayA