Config file not being created
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:~ $
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 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
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).
Thanks for support, got this working with:
- In user home directory
touch my_pyatv.conf -
docker run -it --rm --network=host -v /my_pyatv.conf:/root/.config/pyatv/pyatv.conf ghcr.io/postlund/pyatv:latest atvremote scan