Answers: <p>There is a list of all the important paths Zabbix containers use: <a href="https://www.zabbix.com/documentation/3.0/manual/installation/containers" rel="nofollow noreferrer">https://www.zabbix.com/documentation/3.0/manual/installation/containers</a> 
  (scroll down a bit until you find "Volumes" part). </p>
  
  <p>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. </p>
  
  <p>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: <a href="https://docs.docker.com/storage/volumes/" rel="nofollow noreferrer">https://docs.docker.com/storage/volumes/</a> to read about its advantages.</p>
  
Answers: CC BY-SA 4.0
Answers: 2018-08-06T14:32:00.850Z
Answers: 2018-08-06T14:32:00.850Z
Answers: Yekta Leblebici
Body: <p>I want to run zabbix inside Docker and there are images for MySQL, Nginx and zabbix server ready to go.</p>
  
  <p>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 </p>
  
  <p><code>/var/lib/mysql</code></p>
  
  <p>But what are important parts of zabbix to backup so that the container can stay truest stateless?</p>
  
  <p>From what I can tell it seems to be all the directories under <code>/var/lib/zabbix</code>.</p>
  
Tags: <docker><docker-compose><dockerfile>
Title: What are the correct volume maps for zabbix running on Docker?
UserDisplayName: Wings
ThreadText: # What are the correct volume maps for zabbix running on Docker?
  
  (Asked by: username_0 on 2018-08-01)
  
  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`.
  
  **Tags:** docker, docker-compose, dockerfile
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-08-06. Score: 1 | Accepted answer
  
  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.
  
  
  ---
  
  