Py学习  »  docker

使用主机网络连接Docker中的Steam失败

Jupiter • 3 年前 • 1450 次点击  

我想为我目前正在docker容器中开发的多人游戏托管专用的steam服务器。

我的 Dockerfile :

FROM ubuntu:22.04

RUN useradd -m steam
COPY --chown=steam:steam LinuxServer /home/steam/ 
COPY --chown=steam:steam steamclient.so /home/steam/.steam/sdk64/steamclient.so

USER steam 

WORKDIR /home/steam

CMD  ./Server.sh

我的 docker-compose.yml :

services:
  server:
    image: server
    network_mode: host

启动容器时,专用服务器无法登录到steam。 在里面 Steam/logs/connection_log.txt 它报告OK消息:

[2022-10-11 10:04:10] Connectivity test: Starting test, fetching 'http://test.steampowered.com/204'
[2022-10-11 10:04:10] Connectivity test: OK!
[2022-10-11 10:04:10] Connectivity test: result=Connected (since 0.0s ago), prev=Unknown, in progress=0
[2022-10-11 10:04:22] Connectivity test: Starting test, fetching 'http://test.steampowered.com/204'
[2022-10-11 10:04:22] Connectivity test: OK!
[2022-10-11 10:04:22] Connectivity test: result=Connected (since 11.5s ago), prev=Unknown, in progress=0
[2022-10-11 10:04:23] Connectivity test: Starting test, fetching 'http://test.steampowered.com/204'
[2022-10-11 10:04:23] Connectivity test: OK!

然而,在 Steam/logs/connection_log_7777.txt 它重复以下错误:

[2022-10-11 10:04:10] IPv6 HTTP connectivity test (ipv6check-http.steamcontent.com / [2a01:bc80:8:103::9b85:fc12]:80 ([2a01:bc80:8:103::9b85:fc12]:80)) - TIMEOUT
[2022-10-11 10:04:12] IPv6 UDP connectivity test (ipv6check-udp.steamcontent.com / 2a01:bc80:a:100::b919:b604) - TIMEOUT
[2022-10-11 10:04:21] [0,0] SetSteamID( [G:1:0] )
[2022-10-11 10:04:21] CCMInterface::YieldingConnect -- calling ISteamDirectory/GetCMListForConnect web api
[2022-10-11 10:04:21] [0,0] SetSteamID( [G:1:0] )
[2022-10-11 10:04:21] GetCMListForConnect -- web API call failed (status = 0)
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm2-iad1.cm.steampowered.com.:443) starting...
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm2-lax1.cm.steampowered.com:27021) starting...
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm1-lax1.cm.steampowered.com:27021) starting...
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm2-iad1.cm.steampowered.com.:443) failed talking to cm (timeout/neterror - Invalid)
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm2-lax1.cm.steampowered.com:27021) failed talking to cm (timeout/neterror - Invalid)
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm1-lax1.cm.steampowered.com:27021) failed talking to cm (timeout/neterror - Invalid)
[2022-10-11 10:04:21] [1,3] Connect() starting connection (eNetQOSLevelMedium, cm2-iad1.cm.steampowered.com.:443, WebSocket)
[2022-10-11 10:04:21] [1,0] ConnectFailed('Connection Failed':0) (0.0.0.0:0, WebSocket)
[2022-10-11 10:04:21] [1,0] Client thinks it can connect via: UDP - yes, TCP - yes, WebSocket:443 - yes, WebSocket:Non443 - yes
[2022-10-11 10:04:21] [0,0] StartAutoReconnect() will start in 4.0 seconds (attempt 1)
[2022-10-11 10:04:22] [0,0] SetSteamID( [G:1:0] )

在本地机器上启动专用服务器时,我没有这些问题。我认为它在docker容器中的工作方式与我使用“主机”网络模式时的工作方式相同。有人知道我在这里做错了什么吗?

感谢您的帮助!

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/159275
文章 [ 1 ]  |  最新文章 3 年前