I am using openSUSE Leap 42.3 as host and I have this Dockerfile
FROM opensuse/tumbleweed
RUN zypper --gpg-auto-import-keys refresh
RUN zypper --non-interactive install --force-resolution alsa-utils
ADD test.wav /
CMD [ "/usr/bin/aplay", "/test.wav" ]
I build the image with this command
# docker image build -t aplay_test .
This is the build directory
$ ls -lh
total 9.2M
-rw-r--r-- 1 sergio users 189 Sep 13 15:17 Dockerfile
-rw-r--r-- 1 sergio users 9.2M Sep 13 11:57 test.wav
When I run a container from that image,
# docker container run --rm --device /dev/snd aplay_test
the sound comes from the laptop speakers. But I would like that the sound comes from my headset.
If I execute the following command on my host
$ aplay test.wav
The sound comes from my headset.
How can I do that the sound comes from the headset inside the container?