Node.js Docker NodeJS运行pulseaudio--系统无法打开cookie文件
我试图让NodeJS服务器在Docker内部运行pulseaudio,以便在屏幕上录制Pupeter浏览器。我省略了多余的部分,只提供了一个最简单的例子来说明我的问题。尝试运行Node.js Docker NodeJS运行pulseaudio--系统无法打开cookie文件,node.js,docker,pulseaudio,Node.js,Docker,Pulseaudio,我试图让NodeJS服务器在Docker内部运行pulseaudio,以便在屏幕上录制Pupeter浏览器。我省略了多余的部分,只提供了一个最简单的例子来说明我的问题。尝试运行pulseaudio--system时,无法打开cookie文件。我如何在手之前创建这个文件,或者让它动态创建它 Dockerfile FROM node:14 RUN apt-get update && apt-get install -y pulseaudio RUN apt-get update &
pulseaudio--system
时,无法打开cookie文件。我如何在手之前创建这个文件,或者让它动态创建它
Dockerfile
FROM node:14
RUN apt-get update && apt-get install -y pulseaudio
RUN apt-get update && apt-get install -y pulseaudio-module-zeroconf
RUN apt-get update && apt-get install -y dbus-x11
RUN echo "load-module module-native-protocol-tcp auth-anonymous=1" >> /etc/pulse/default.pa
RUN echo "load-module module-zeroconf-publish" >> /etc/pulse/default.pa
COPY . .
CMD bash start_node.sh
启动节点。sh
#!/bin/bash
service dbus restart
export $(dbus-launch)
pulseaudio --system
要运行的命令
docker build -t pulseaudio .
docker run -it --rm pulseaudio
输出
[ ok ] Stopping system message bus: dbus.
[ ok ] Starting system message bus: dbus.
W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set.
W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set.
N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode.
N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time.
W: [pulseaudio] main.c: OK, so you are running PA in system mode. Please make sure that you actually do want to do that.W: [pulseaudio] main.c: Please read http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/ for an explanation why system mode is usually a bad idea.
W: [pulseaudio] authkey.c: Failed to open cookie file '/var/run/pulse/.config/pulse/cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to load authentication key '/var/run/pulse/.config/pulse/cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to open cookie file '/var/run/pulse/.pulse-cookie': No such file or directory
W: [pulseaudio] authkey.c: Failed to load authentication key '/var/run/pulse/.pulse-cookie': No such file or directory
如果您正在使用根用户以使其工作,则需要启动PulseAudio守护进程
换行
pulseaudio-D——系统