Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to docker-airconnect 👋

Version

A simple and lightweight Docker image based on Alpine Linux to stream AirPlay to Sonos effortlessly. Based on @philippe44's fantastic work.

The easy way

docker run -d --net=host tratosca/docker-airconnect

Remove -d to run in foreground (not recommended)

--net=host is required to run in true bridged mode (allowing the container to be in the same IP subnet than the Docker host, your Sonos system and your AirPlay sender; at least on most configurations)

Using environment variables

You can pass some facultative environment variables to this app:

  • CODEC=mp3:bitrate|flc:quality|wav (flc is for FLAC). bitrate must be specified if using MP3). Default: flc

  • METADATA=1|0 either if you wish to broadcast songs metadata to Sonos (1) or not (0). Default: 1

  • LATENCY=integer:integer in the format of number:number where the firs is the AirPlay latency and the second is the Sonos latency. Increase value of the first one if your network is bad. The second is quite failsafe actually. Default 500:500)

  • ARTWORK=1|0 either if you wish to broadcast the artwork pic to Sonos (1) or not (0). Default: 1

  • NAME=your_fantastic_desired_name for customizing the name of the AirPlay device. Only works if you build the image with your own conf file in /etc that already contains a single Sonos device. Default: Sonos+.

  • $MAXVOLUME=1..100 for editing the max volume of the Sonos device that can be set from your AirPlay sender device. Default: 100

Building the image

git clone https://github.com/ItsPops/docker-airconnect.git
cd docker-airconnect
docker build . --tag yourself/airconnect

Using docker-compose

Create a docker-compose.yml file with this sample config:

services:
  airconnect:
    network_mode: "host"
    container_name: airconnect
    image: tratosca/docker-airconnect
    environment:
    - CODEC='wav'

Run it, daemonized:

docker-compose up -d

Changing the name of a Sonos receiver

By manually editing etc/airupnp.conf and start.sh

  1. Run the container once to let it detect your devices
docker run -d --net=host tratosca/docker-airconnect
  1. Open a shell to the container
docker exec -ti airconnect sh
  1. Generate a sample conf file that will override the default one
airupnp -i /etc/airupnp.conf

After a few seconds press Ctrl+C to exit and return to the container shell.

  1. Edit the conf file with vi
vi /etc/airupnp.conf
  1. Locate the name parameter and edit the value with the name you want :)

By passing the name env variable (only works if a single Sonos device is detected)

  1. Follow the guide below from step 1. to step 4. and add an env variable as NAME=your_device_name in your docker-compose.yml file or in the command.

To do:

☐ Multi platform Docker image building (current image not tested on x86_64)

☐ Adding AirCast to allow streaming to Chromecast

☐ Adding more env variables to edit things

☐ Building from latest AirConnect sources instead of precompiled binaries

Many thanks to:

@1activegeek for his multiplatform build technique

@miegl for his env variable passing shell script

@philippe44 most importantly for Airconnect !

@kefranabg for this readme-md-generator

About

A simple and lightweight Docker image based on Alpine Linux to stream AirPlay to Sonos effortlessly.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Packages

Contributors

Languages