I’m having issues running Zabbix 6.2 (or any other version) with Docker for Mac.
I can pull the docker compose file without any issues, however, seems like the databases for zabbix are empty.
I googled to no avail, also checked with Zabbix devs, but seems like issue is with Docker for Mac and the permissions it uses? not sure really.
When I access the Zabbix database, I get this:
mysql> select * from users;
Empty set (0.00 sec)
I’m at loss as to why the docker compose image would not populate the database info into the tables… any help? It would be greatly appreciated!
** Env **
MacOS Catalina v10.15.7 (19H1922)
Docker for Desktop v4.12.0 (85629)
Credential Helper: v0.6.4
Steps to reproduce:
git clone https://github.com/zabbix/zabbix-docker
docker-compose --profile=all -f docker-compose_v3_alpine_mysql_latest.yaml pull
docker-compose --profile=all -f docker-compose_v3_alpine_mysql_latest.yaml up
All containers will load ok except
zabbix-docker_db_data_mysql_1 which is the only one based on busybox:latest , Image history reads the following commands:
/bin/sh -c #(nop) CMD ["sh"]
/bin/sh -c #(nop) ADD file:53723549e9db3eb5bd54de44e4a1ed8c6012cedd751a934d8df2c3c34cd03349 in /
By “load” you mean start? Have you checked the logs? That data container will not do anything. It will exit with the exit code 0. I don’t understand the point of that container since nothing refers to it. It is not even a dependency of any container, but you try to use the latest commit in the master branch which is not always stable. Check the logs, because you should see some error message there.
docker-compose --profile=all -f docker-compose_v3_alpine_mysql_latest.yaml logs
Hello @rimelek! Thanks for your reply!
Yes, by load I mean start (sorry, new to Docker, need to start using proper terminology).
Thanks for explaining that the data containers will not do anything. So I can expect the same behaviour from the same type of containers? (i.e: The container does not start).
Also, how do you tell it’s a data container? Only from the word ‘data’ in the name? I docker inspected it, and cannot tell from the info.
Is there a way to view the data contained in it?
I will definitely take your advice and try to go back to an earlier commit!
Note: I did try
docker-compose --profile=all -f docker-compose_v3_alpine_mysql_latest.yaml logs but I get no mention of the image/container for zabbix-docker_db_data_mysql_1. Is there a way to filter the logs by image that is not grep?
I called it data container because of its name. I always used named volumes or bind mounts, but I know some peiple just ran a container with its anonymous volumes defined in the Docker image and used the “volumes-from” parameter to mount all the volumes from that container to an other container. I don’t exactly know what. Maybe it was used before named volumes was implemented (if it was not always there) or there was some other benefits. In the case of the zabbix containers, I don’t see any reference to that container, so for me it does not make sense. I guess yo could ask the maintainer of the image on GitHub.
It does not contain anything. As you noticed, it is just a busybox container that mounts a folder and does nothing with it.
Yes, this is the point. That container does nothing, so you will not see any logs. But you can see the logs of the other containers.
Whether a stopped/exited container is normal or not it depends on the actual project. Some containers just helper containers or init containers. They do something and stop. When you run the compose project again, they start again and stop. It can be used to fix file permissions or owners on the host so an other container can mount that folder from the host. Again, in this case, that container does nothing. Since nothing refers to the container, it is not a dependency of any container, it is not even guaranteed that this container will start before other containers. It is very likely though, because it does nothing and doing nothing can be done very fast
Thanks a lot @rimelek for the detailed response! Now I get a better idea of how everything is orchestrated together in this project
I will remember each of these points next time I have the same question, and will definitely bookmark this thread for future reference.
Again thanks a lot for your time, hope you have a great Sunday!