startersclan/bf2stats:
shdocker run --rm -it -p 80:80 -e DB_HOST=db -e DB_PORT=3306 -e DB_NAME=bf2stats -e DB_USER=admin -e DB_PASS=admin startersclan/bf2stats:2.9.4-asp
bf2sclone image (for supported environment variables, see here):
shdocker run --rm -it -p 80:80 -e DBIP=db -e DBNAME=bf2stats -e DBLOGIN=admin -e DBPASSWORD=admin startersclan/bf2stats:2.9.4-bf2sclone
See this example showing how to deploy Battlefield 2 1.5 server, PRMasterserver as the master server, and bf2stats as the stats web server, using docker-compose.
See this example showing how to deploy Battlefield 2 1.5 server, with BF2Hub as the master server and bf2stats as the stats web server, using docker-compose.
v2.2.0 and v2.5.x: Bump the docker image tags, login to the ASP and click follow the instructions to upgrade the DB<= v2.5.x, see instructions to upgrade to v2.6.x herev2.6.0 and above: Bump the docker image tags, login to the ASP and click follow the instructions to upgrade the DBTo use Docker Compose v2, use docker compose instead of docker-compose.
sh# 1. Start docker-compose up --build # ASP available at http://localhost:8081/ASP. Username: admin, password admin. Login and set up the DB the first time. See ./config/ASP/config.php # bf2sclone available at http://localhost:8082 # phpmyadmin available at http://localhost:8083. Username: admin, password: admin. See ./config/ASP/config.php config file # 2. If you have just setup the DB the first time, restart the BF2 server to begin recording stats docker-compose restart bf2 # 3. Before launching the BF2 client, spoof gamespy DNS by adding these entries in C:\Windows\system32\drivers\etc\hosts. This is needed for the BF2 client to work correctly. # Replace '192.168.1.100' with your development machine's IP address 192.168.1.100 battlefield2.available.gamespy.com 192.168.1.100 battlefield2.master.gamespy.com 192.168.1.100 battlefield2.ms14.gamespy.com 192.168.1.100 master.gamespy.com 192.168.1.100 motd.gamespy.com 192.168.1.100 gpsp.gamespy.com 192.168.1.100 gpcm.gamespy.com 192.168.1.100 gamespy.com 192.168.1.100 bf2web.gamespy.com 192.168.1.100 gamestats.gamespy.com 192.168.1.100 eapusher.dice.se # 4. Launch BF2 client and connect to the BF2 server # - To use BF2Hub as the Gamespy server, launch BF2.exe, and login to your BF2Hub account, and connect to the BF2 server using MULTIPLAYER > CONNECT TO IP # - To use PRMasterserver in docker-compose as the Gamespy server, if you have previously patched BF2.exe using the BF2Hub patcher, you must unpatch BF2.exe. Then launch BF2.exe (do not use BF2Hub), create a new Online account, login, and connect to the BF2 server using MULTIPLAYER > CONNECT TO IP. # At the end of a round, the BF2 server will send a stats snapshot to the ASP. View stats in ASP and bf2sclone. # Development - Install vscode extensions # Once installed, set breakpoints in code, and press F5 to start debugging. code --install-extension bmewburn.vscode-intelephense-client # PHP intellisense code --install-extension xdebug.php-debug # PHP remote debugging via xdebug code --install-extension ms-python.python # Python intellisense # If xdebug is not working, iptables INPUT chain may be set to DROP on the docker bridge. # Execute this to allow php to reach the host machine via the docker0 bridge sudo iptables -A INPUT -i br+ -j ACCEPT # BF2 server - Restart server docker-compose restart bf2 # BF2 server - Attach to the bf2 server console docker attach $( docker-compose ps -q bf2 ) # BF2 server - Exec into container docker exec -it $( docker-compose ps -q bf2) bash # BF2 server - Read logs docker exec -it $( docker-compose ps -q bf2 ) bash -c 'cat python/bf2/logs/bf2game_*' # BF2 server - List snapshots docker exec -it $( docker-compose ps -q bf2 ) ls -alR python/bf2/logs/snapshots/unsent # asp - Exec into container docker exec -it $( docker-compose ps -q asp ) sh # asp - List backups docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/database/backups # asp - List config docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/config # asp - Read logs docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/logs # asp - List snapshots docker exec -it $( docker-compose ps -q asp ) ls -alR /src/ASP/system/snapshots # Test ./test/test.sh dev 1 # Test production builds 1 ./test/test.sh prod1 1 # Test production builds 2 ./test/test.sh prod2 1 # Test a snapshot curl -s -A GameSpyHTTP/1.0 -H 'Content-Type: application/json' --data @test/snapshots/-test-snapshot.txt localhost:8081/ASP/bf2statistics.php # Dump the DB docker exec $( docker-compose ps -q db ) mysqldump -uroot -padmin bf2stats | gzip > bf2stats.sql.gz # Restore the DB zcat bf2stats.sql.gz | docker exec -i $( docker-compose ps -q db ) mysql -uroot -padmin bf2stats # Stop docker-compose down # Cleanup docker-compose down --remove-orphans docker volume rm bf2stats_prmasterserver-volume docker volume rm bf2stats_backups-volume docker volume rm bf2stats_config-volume docker volume rm bf2stats_logs-volume docker volume rm bf2stats_snapshots-volume docker volume rm bf2stats_bf2sclone-cache-volume docker volume rm bf2stats_db-volume
sh./release.sh 2.x.x git add . git commit -m "Chore: Release 2.x.x"
A: This is caused by a bug where the UI fails to handle an invalid response from the backend. A PHP_ERROR Warning: file_put_contents(/src/ASP/system/config/config.php): failed to open stream: Permission denied in /src/ASP/system/core/Config.php on line 165 is output before the JSON response causing invalid JSON.
Grant PHP write permission for config.php.
shchmod 666 ./config/ASP/config.php docker-compose restart asp
Warning: file_put_contents(/src/ASP/system/config/config.php): failed to open stream: Permission denied in /src/ASP/system/core/Config.php on line 165 appearing in ASP dashboardA: Grant the PHP user write permission for ./src/ASP/system/config/config.php.
There was an error testing the system. Please refresh the page and try again. when using System > Test System in ASPA: This is means the UI received an invalid JSON response from the backend. If you know how to, you can examine the payload of the POST response.
BF2Statistics Processing Check: Fail or Gamespy (.aspx) Basic Response: Fail or Gamespy (.aspx) Advanced (1) Response: Fail when using System > Test System in ASPA: DNS resolution problem. The HOST used in the test to test those Gamespy endpoints is the same host you see in your browser. For instance, if you are accessing the ASP using [***], ASP runs tests against [***], which will may fail if DNS resolution for yourdomain.com fails.
If you see this in a development environment, simply ignore the errors. There is an integration test to those endpoints to ensure they work.
If you are seeing this in a production environment, use a fully qualified domain name (FQDN) so that ASP can resolve to its external DNS name to test against its external web endpoint.
Importing Logs Failed! when using Server Admin > Import Logs in ASPA: Same as this
Table (army) *NOT* Backed Up: [1045] Access denied for user 'admin'@'%' (using password: YES) when using System > Backup Database in ASPA: The db user does not have the FILE privilege. Add a grant manually. But note that even if you did, you still won't be able to backup without major security issues. See here.
Table (army) *NOT* Backed Up: [1] Can't create/write to file when using System > Backup Database in ASPThe backupdb module uses SELECT * INTO OUTFILE, but the src files are not in the db container, mariadb cannot find the path to export the files. In the past, the apache, php and mysql ran on the same machine with write access to the same filesystem, but with docker, each container has its own filesystem. The only workaround is to mount the backups-volume inside the db container at the same path as it is mounted in the ASP container /src/ASP/system/database/backups/, with write permissions for php's user 82 and mariadb's user 999 which menas the directory needs 777 permissions (world writeable), which is very bad from the point of view of security.
It is better to backup the DB on a cron schedule using mysqldump from another container linked to the db container:
sh# Dump a DB at host `db`, user `root`, password `admin`, database `bf2stats` mysqldump -hdb -uroot -padmin bf2stats
Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9000 (through xdebug.client_host/xdebug.client_port) appears in PHP logs on docker-compose upA: If you are seeing this in development, the PHP debugger is not running. Press F5 in vscode to start the PHP debugger. If you don't need debugging, set XDEBUG_MODE=off in docker-compose.yml to disable XDebug.
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像服务
在 Docker Desktop 配置镜像
Docker Compose 项目配置
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
MacOS OrbStack 容器配置
在宝塔面板一键配置镜像
Synology 群晖 NAS 配置
飞牛 fnOS 系统配置镜像
极空间 NAS 系统配置服务
爱快 iKuai 路由系统配置
绿联 NAS 系统配置镜像
QNAP 威联通 NAS 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
来自真实用户的反馈,见证轩辕镜像的优质服务