pyatv icon indicating copy to clipboard operation
pyatv copied to clipboard

Config file not being created

Open romsandmore opened this issue 7 months ago • 4 comments

What do you need help with?

I am trying to run pyatv in a docker container, but it is not creating any pyatv.conf file after running the wizard. Does anyone have the persistent mount working with a docker container?

docker run -it --rm --network=host -v ~/docker/pyatv_config:/root/.config/pyatv ghcr.io/postlund/pyatv:latest atvremote wizard

Pairing finished, trying to connect and get some metadata...
Currently playing:
  Media type: Unknown
Device state: Idle
      Repeat: Off
     Shuffle: Off
Device is now set up!
Name: Entertainment Room
Model/SW: Apple TV 4K, tvOS 18.5
Address: 192.168.100.120
MAC: 46:4B:DE:8F:33:0F
Deep Sleep: False
Identifiers:
 - 444BDE8F-330F-4EEE-AD80-4611A9A4B347
 - 46:4B:DE:8F:33:0F
 - 464BDE8F330F
Services:
 - Protocol: Companion, Port: 49153, Credentials: None, Requires Password: False, Password: None, Pairing: Mandatory
 - Protocol: AirPlay, Port: 7000, Credentials: None, Requires Password: False, Password: None, Pairing: Mandatory
 - Protocol: RAOP, Port: 7000, Credentials: None, Requires Password: False, Password: None, Pairing: Mandatory
pi@raspberrypi:~ $ ls ~/docker/pyatv_config
pi@raspberrypi:~ $

romsandmore avatar Aug 03 '25 17:08 romsandmore

It is created in the home directory of the running user, e.g. /root/pyatv.conf. So you should set up /root as a volume and hopefully that will work.

postlund avatar Aug 03 '25 18:08 postlund

@postlund thanks for the quick reply. I tried changing to the home directory, but still don't see any pyatv.conf in the home directory after running the wizard. Any ideas?

docker run -it --rm --network=host -v /home/pi:/root/.config/pyatv ghcr.io/postlund/pyatv:latest atvremote wizard

romsandmore avatar Aug 03 '25 18:08 romsandmore

Right, I think HOME is at to just / in that image. You can try binding /.pyatv.conf as a volume directly (-v /.pyatv.conf:/somewhere/pyatv.conf).

postlund avatar Aug 03 '25 20:08 postlund

Thanks for support, got this working with:

  1. In user home directory touch my_pyatv.conf
  2. docker run -it --rm --network=host -v /my_pyatv.conf:/root/.config/pyatv/pyatv.conf ghcr.io/postlund/pyatv:latest atvremote scan

romsandmore avatar Aug 15 '25 04:08 romsandmore