mbind: Operation not permitted
The MySQL container kept crash looping, causing over an hour of downtime before I had it resolved fully. Here's the solution I found...
Have you ever had those moments when you make a DevOops mistake? That happened to me recently when I was deploying this very blog and it introduced an interesting issue with MySQL docker container image on version 8. The MySQL container kept crash looping, causing over an hour of downtime before I had it resolved fully.
The Problem
I was running this blog previously on Wordpress with MySQL in docker and the MySQL:latest docker kept crashing with an error in the logs: mbind: Operation not permitted
. It's apparently a common issue and took a good amount of searching to find a proper solution.
It has to do with "seccomp" security values in docker. Docker has an article on it (here) and how to set the parameter, but I must say this is my first encounter with needing to explicity flag this.
The Solution
In order to fix your broken MySQL instance, you'll want to flag the security-opt like so:
--security-opt seccomp=unconfined
This will get the mbind issues to cease and you should have no issue running the MySQL containers anymore.
Takeaways
I'm surprised that this is an issue given how well known MySQL is and given the fact their previous versions had no issue, I wonder what has changed in the environment to cause these issues.