Running Audirvana Studio in Docker with Samba Shares

Running Audirvana Studio in Docker with Samba Shares

Hey there, Linux audio enthusiasts! :headphones: Are you ready to rock Audirvana Studio in a Docker container? :whale: And what’s even better? I’ll show you how to automatically mount your Samba shares, so you can listen to your local tunes without breaking a sweat! :dancer: Before we dive in, let’s make sure we’re on the same page:

  • You’re a Linux CLI wizard :man_mage:
  • Docker and Docker Compose are your trusty sidekicks (if not, check out the official docs: Docker, Docker Compose)
  • You’ve got the latest Audirvana Debian package ready to roll (download it here)
  • Your Samba server is up and running, and your credentials are good to go :muscle:

Now, let’s get this party started! :tada:

Step 1: Build the Audirvana Studio Docker Image

First, create a Dockerfile with the following content:

Dockerfile

# Use the latest Ubuntu LTS as base image
FROM ubuntu:22.04

# Avoid user interaction with tzdata
ENV DEBIAN_FRONTEND=noninteractive

# Update and install necessary packages
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    gdebi-core

# Download the latest Audirvana Studio deb package
ADD https://audirvana.com/delivery/AudirvanaLinux.php?product=studio&arch=amd64&distrib=deb /tmp/audirvana-studio.deb

# Install the Audirvana Studio deb package along with its dependencies
RUN gdebi -n /tmp/audirvana-studio.deb

# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Modify nsswitch.conf
RUN sed -i 's/hosts: files dns/hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4/g' /etc/nsswitch.conf

# Set up the entrypoint to run Audirvana Studio
ENTRYPOINT ["/opt/audirvana/studio/audirvanaStudio"]

Note: If you’ve already downloaded the Audirvana Studio deb file, replace the ADD instruction with COPY audirvana-studio_2.8.1.3_amd64.deb /tmp/audirvana-studio.deb (replace 2.8.1.3 with the matching version you’ve downloaded.

Now, using your favorite terminal emulator, cd /path/to/Dockerfile and build the Docker image with:

docker build -t audirvana-studio:latest .

Or, if you like your tags organized:

docker build -t audirvana-studio:<VERSION-HERE>

Step 2: Set Up the Docker Compose File

Create a docker-compose.yml file with the following content:

yaml

services:
  audirvana-studio:
    image: audirvana-studio:latest
    container_name: "audirvana-studio"
    network_mode: host
    privileged: false
    devices:
      - /dev/snd
    volumes:
      - audirvana-configs:/root/.config
      - /var/run/dbus:/var/run/dbus
      - music:/music
    restart: "unless-stopped"

volumes:
  audirvana-configs:
  music:
    driver: local
    driver_opts:
      type: cifs
      device: //192.168.1.10/Music
      o: addr=192.168.1.10,username=SAMBAUSER,password=SAMBAPASSWORD

Replace 192.168.1.10, SAMBAUSER, and SAMBAPASSWORD with your Samba server details. To keep your Samba password secure, consider using Docker Secrets or environment variables. For example, you can create a .env file with SAMBA_PASSWORD=your_password and reference it in the docker-compose.yml file as ${SAMBA_PASSWORD}. Ansible Vault may also be an option for encrypting your password, but is outside the scope of this article.

Note: You can set privileged: to “true” to troubleshoot error messages, but generally you shouldn’t need it!

Step 3: Start the Audirvana Studio Container

Navigate to the directory containing the docker-compose.yml file and run:

docker-compose up -d

To view the logs, use:

docker-compose logs -f

The Magic of Docker Volumes :magic_wand:

Now, here’s the really cool part: thanks to Docker volumes, you can safely stop the Audirvana Studio container without losing your precious index data! :tada: When you run docker-compose down, the container will be stopped and removed, but your index data will remain safe and sound in the audirvana-configs volume. The next time you start the container with docker-compose up -d, Audirvana Studio will pick up right where it left off, with all your settings and library information intact. :sunglasses:

And there you have it! Your Audirvana Studio is now running in a Docker container, ready to rock your Samba shares and blast those hidden gems from your collection, like that ultra-rare live recording of “The Spaghetti Incident” by Weird Al Yankovic featuring Tiny Tim on ukulele! :guitar::spaghetti:

Remember, this is free information, so no warranty! If you get stuck, don’t be afraid to consult your favorite search engine or language model for help. :robot: Happy listening! :notes:

3 Likes