测试把UnityRenderStreaming部署在docker,剧透一下,嘎了……
当然webserver运行的妥妥的
那么打包出的程序运行log
Mono path[0] = '/home/unity/Broadcast/Broadcast_Data/Managed'
Mono config path = '/home/unity/Broadcast/Broadcast_Data/MonoBleedingEdge/etc'
Found 1 interfaces on host : 0) 172.17.0.2
Multi-casting "[IP] 172.17.0.2 [Port] 55000 [Flags] 2 [Guid] 1613740712 [EditorId] 4137315725 [Version] 1048832 [Id] L>
Starting managed debugger on port 56712
Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=0.0.0.0:56712
Preloaded 'libwebrtc.so'
AS: AutoStreaming module initializing.
Unable to load player prefs
Desktop is 0 x 0 @ 0 Hz
dockerfile和start.sh
FROM ubuntu:24.04USER root
LABEL maintainer="xuefei"RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:123456' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]# 创建用户和组
RUN groupadd -r xuefei && useradd -r -g xuefei -m -u 2000 xuefei# 复制文件
COPY --chown=2000:xuefei ./unity /home/unity# 设置权限
RUN chmod -R 755 /home/unity
EXPOSE 8080 80# 切换到非root用户
USER 2000# 设置工作目录
WORKDIR /home/unityENTRYPOINT ["/home/unity/start.sh"]
#!/bin/bash
export XDG_RUNTIME_DIR=/unity
./webserver -p 80 &
./Broadcast/Broadcast.x86_64 &
wait
一些参考链接
https://discussions.unity.com/t/render-streaming-app-crash-in-linux-container-headless/897617/9
https://askubuntu.com/questions/1072918/running-unity3d-game-on-linux-minimal
https://discussions.unity.com/t/webrtc-is-disconnected-in-the-linux-container/902496
https://wiki.archlinux.org/title/Unity3D
这个很专业,但看不懂,明天继续……
https://zhuanlan.zhihu.com/p/521023922