berngp / docker-zabbix

Docker Container running a Zabbix Server and Zabbix Web UI.
Other
160 stars 66 forks source link

Can't run zabbix after container stop/commit #29

Open ghost opened 8 years ago

ghost commented 8 years ago

When i configure zabbix, i stop a container and commit it. Then i can't run zabbix anymore. I thought the problem was in mysql_secure_installation script, because it runs anytime when i'm tring to start or restart mysql. Anyway, after run mysql_secure_installation script i've changed a credentials for mysql root password and added it to /bin/docker-zabbix script. Anyway after commiting a container mysql doesn't contain zabbix database. It just dissapear. Can't find a solution.

Franselbaer commented 7 years ago

Just comment the volumes out:

VOLUME ["/var/lib/mysql", "/usr/lib/zabbix/alertscripts", "/usr/lib/zabbix/externalscripts", "/etc/zabbix/zabbix_agentd.d"]

change to

#VOLUME ["/var/lib/mysql", "/usr/lib/zabbix/alertscripts", "/usr/lib/zabbix/externalscripts", "/etc/zabbix/zabbix_agentd.d"]

The usage of "volumes" causing the database is stored outsite of the container in a temporary folder on the host. If you commit and start a new folder is created on the host (its a folder with an dynamic id number).

If you comment this out the whole db is stored within the container. If you commit or save or export the db is stored within...

(not tested yet)

ghost commented 7 years ago

@Franselbaer Thanks!

Someone234 commented 7 years ago

@Franselbaer In which file could find the "[VOLUME......"?