I am having issues getting my MySQL container to run some initialisation scripts (creating some databases) from Docker Compose. As per the documentation on Docker Hub, I mo
Check if this is a docker-compose issue (like issue 115 which redirected to issue 2266)
I don't think the error is related to build, it's mostly likely volumes.
Compose preserves volumes so that you don't lose data (this will be better documented in the next release).To remove those volumes run
docker-compose rm -vf
. The next time you docker-compose up it should start with fresh empty volumes.
According to hub.docker.com/mysql, check also if this is not a synchronization issue:
If there is no database initialized when the container starts, then a default database will be created. While this is the expected behavior, this means that it will not accept incoming connections until such initialization completes. This may cause issues when using automation tools, such as docker-compose, which start several containers simultaneously.