From d0bc04133c59e0cc34596c57838a04d3f0260f5e Mon Sep 17 00:00:00 2001 From: judahpaul16 Date: Sun, 19 May 2024 20:04:02 -0400 Subject: [PATCH 1/2] Use `tee` to create alsa config --- README.md | 2 +- contrib/setup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d4d818e..b2afefe 100644 --- a/README.md +++ b/README.md @@ -559,7 +559,7 @@ sudo systemctl enable docker sudo systemctl start docker # Create ALSA config (asound.conf, adjust as needed) -sudo cat > /etc/asound.conf < /dev/null < /etc/asound.conf < /dev/null < Date: Sun, 19 May 2024 20:24:03 -0400 Subject: [PATCH 2/2] Updated alsa virtual mount --- README.md | 8 ++++---- contrib/setup.sh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b2afefe..e65a9f7 100644 --- a/README.md +++ b/README.md @@ -419,12 +419,12 @@ This will start the container and drop you into a shell session inside the conta Provides access to the host's sound devices. -v /dev/shm:/dev/shm: Provides access to shared memory. --v /etc/asound.conf:/etc/asound.conf:ro: - Maps the ALSA configuration file as read-only. -v /usr/share/alsa:/usr/share/alsa:ro: Maps the ALSA shared data as read-only. -v /var/run/dbus:/var/run/dbus: Provides access to the D-Bus system for inter-process communication. +--mount type=bind,source=/etc/asound.conf,target=/etc/asound.conf: + Binds the host's ALSA configuration to the container. ``` ### 🐚 setup.sh @@ -655,6 +655,7 @@ if [[ "$1" != "--no-build" ]]; then echo "Running container 'gpt-home' from image 'gpt-home'..." docker run --restart unless-stopped -d --name gpt-home \ + --mount type=bind,source=/etc/asound.conf,target=/etc/asound.conf \ --privileged \ --net=host \ --tmpfs /run \ @@ -662,7 +663,6 @@ if [[ "$1" != "--no-build" ]]; then -v ~/gpt-home:/app \ -v /dev/snd:/dev/snd \ -v /dev/shm:/dev/shm \ - -v /etc/asound.conf:/etc/asound.conf \ -v /usr/share/alsa:/usr/share/alsa \ -v /var/run/dbus:/var/run/dbus \ -e OPENAI_API_KEY=$OPENAI_API_KEY \ @@ -683,13 +683,13 @@ if [[ "$1" == "--no-build" ]]; then docker ps -aq -f name=gpt-home | xargs -r docker rm -f docker pull judahpaul/gpt-home docker run --restart unless-stopped -d --name gpt-home \ + --mount type=bind,source=/etc/asound.conf,target=/etc/asound.conf \ --privileged \ --net=host \ --tmpfs /run \ --tmpfs /run/lock \ -v /dev/snd:/dev/snd \ -v /dev/shm:/dev/shm \ - -v /etc/asound.conf:/etc/asound.conf \ -v /usr/share/alsa:/usr/share/alsa \ -v /var/run/dbus:/var/run/dbus \ -e OPENAI_API_KEY=$OPENAI_API_KEY \ diff --git a/contrib/setup.sh b/contrib/setup.sh index ac5882e..e69ad83 100644 --- a/contrib/setup.sh +++ b/contrib/setup.sh @@ -218,6 +218,7 @@ if [[ "$1" != "--no-build" ]]; then echo "Running container 'gpt-home' from image 'gpt-home'..." docker run --restart unless-stopped -d --name gpt-home \ + --mount type=bind,source=/etc/asound.conf,target=/etc/asound.conf \ --privileged \ --net=host \ --tmpfs /run \ @@ -225,7 +226,6 @@ if [[ "$1" != "--no-build" ]]; then -v ~/gpt-home:/app \ -v /dev/snd:/dev/snd \ -v /dev/shm:/dev/shm \ - -v /etc/asound.conf:/etc/asound.conf \ -v /usr/share/alsa:/usr/share/alsa \ -v /var/run/dbus:/var/run/dbus \ -e OPENAI_API_KEY=$OPENAI_API_KEY \ @@ -246,13 +246,13 @@ if [[ "$1" == "--no-build" ]]; then docker ps -aq -f name=gpt-home | xargs -r docker rm -f docker pull judahpaul/gpt-home docker run --restart unless-stopped -d --name gpt-home \ + --mount type=bind,source=/etc/asound.conf,target=/etc/asound.conf \ --privileged \ --net=host \ --tmpfs /run \ --tmpfs /run/lock \ -v /dev/snd:/dev/snd \ -v /dev/shm:/dev/shm \ - -v /etc/asound.conf:/etc/asound.conf \ -v /usr/share/alsa:/usr/share/alsa \ -v /var/run/dbus:/var/run/dbus \ -e OPENAI_API_KEY=$OPENAI_API_KEY \