Help choose volume type for zigbee2mqtt container

Greeting. I want to install zigbee2mqtt container in Portainer. The examples in the zigbee2mqtt installation guide show how to create a volume using the binding of the OS directories to the container directories.

   -v $(pwd)/data:/app/data \
   -v /run/udev:/run/udev:ro \

However, creating a volume in Portainer is easier and it is recommended by docker

Can I use volume for the /app/data and /run/udev directories of the zigbee2mqtt container?

Would you not think the best recommendation would come from the specific application for it’s docker configuration, in this case Zigbee2MQTT? Docker’s recommendations would seem to be a generic recommendation for generic docker applications. Probably a good default, if the specific application did not make a recommendation for how to run it in a docker environment. And your point about ‘creating a volume is easier’, if true, would you not think that the creation part is just a one time item vs. operation part which is an on going effort?

I’ve run zigbee2mqtt with it’s storage location mapped to the docker host’s file system for 4+ years and it has worked well, on rpi, native linux machine and proxmox vm hosts. I have not found zigbee2mqtt to be a very file system intensive application. It’s most critical ‘file system’ connection is being able to communicate with it’s coordinator hardware, and it really does not have any option other than to map that to the host. This mapping is where most folks find challenges due to the USB mapping and understanding how this works between docker and the host.

Being able to get to zigbee2mqtt’s config, log and other directories regardless of whether the application is running or not has been useful. I realize you can get to the same with docker volumes, however why add this overhead was part of my method selection.

I’m sure there are pluses and minuses to both methods. Making sure you can run your docker apps without being root on host is a good thing to understand and be able to do.

Good hunting!

1 Like