2

I want to run zabbix inside Docker and there are images for MySQL, Nginx and zabbix server ready to go.

I know that to keep the containers stateless I need to map a volume on the host to the container. I know that for MySQL the important container volume to map is

/var/lib/mysql

But what are important parts of zabbix to backup so that the container can stay truest stateless?

From what I can tell it seems to be all the directories under /var/lib/zabbix.

1

There is a list of all the important paths Zabbix containers use: https://www.zabbix.com/documentation/3.0/manual/installation/containers (scroll down a bit until you find "Volumes" part).

If I were you, instead of bind mounting these directories I would build a derivative image from the official Zabbix image and run statements like "COPY my_alertscript.sh /var/lib/zabbix/alertscripts/" in the build phase.

If, for some reason, baking your changes to the image itself is not possible, then you may still want to prefer named volumes instead of bind mounting. See: https://docs.docker.com/storage/volumes/ to read about its advantages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.