我正在尝试在 Docker 容器内模拟无头 chrome 实例的麦克风输入。
基于在 Docker 容器内模拟 Chrome 的麦克风输入,我有以下设置:
Dockerfile
FROM buildkite/puppeteer:latest
RUN apt-get -qq update && apt-get install -y pulseaudio
COPY entrypoint.sh /opt/bin/entrypoint.sh
RUN useradd -ms /bin/bash bot
USER bot
ENTRYPOINT /opt/bin/entrypoint.sh
Run Code Online (Sandbox Code Playgroud)
entrypoint.sh
FROM buildkite/puppeteer:latest
RUN apt-get -qq update && apt-get install -y pulseaudio
COPY entrypoint.sh /opt/bin/entrypoint.sh
RUN useradd -ms /bin/bash bot
USER bot
ENTRYPOINT /opt/bin/entrypoint.sh
Run Code Online (Sandbox Code Playgroud)
运行容器时pulseaudio -D --verbose --exit-idle-time=-1失败,但没有更多详细信息:
E: [pulseaudio] main.c: Daemon startup failed.
Run Code Online (Sandbox Code Playgroud)
我可以排除pulseaudio在容器内自动启动的可能性,因为后续输出如下:
Connection failure: Connection refused
Connection failure: Connection …Run Code Online (Sandbox Code Playgroud)