绝对有可能,您需要挂载/ dev / snd,看看Jess Frazelle如何启动Spotify容器,从
https://blog.jessfraz.com/post/docker-containers-on-the-
desktop/
你会注意到
docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix # mount the X11 socket -e DISPLAY=unix$DISPLAY # pass the display --device /dev/snd # sound --name spotify jess/spotify
或对于Chrome,最后
docker run -it --net host # may as well YOLO --cpuset-cpus 0 # control the cpu --memory 512mb # max memory it can use -v /tmp/.X11-unix:/tmp/.X11-unix # mount the X11 socket -e DISPLAY=unix$DISPLAY # pass the display -v $HOME/Downloads:/root/Downloads # optional, but nice -v $HOME/.config/google-chrome/:/data # if you want to save state --device /dev/snd # so we have sound --name chrome jess/chrome



