How to fix "mbind: Operation not permitted" in mysql error log

Add the capability CAP_SYS_NICE to your container until MySQL server can handle the error itself "silently".

service:
  mysql:
    image: mysql:8.0.15
    # ...
    cap_add:
      - SYS_NICE  # CAP_SYS_NICE

If you dont have docker-compose, then you can define CAP_SYS_NICE via

docker run --cap-add=sys_nice -d mysql

References:

  • Docker Seccomp security profiles: https://docs.docker.com/engine/security/seccomp/
  • Docker resource constraints: https://docs.docker.com/config/containers/resource_constraints/

Adding the security_opt option in docker-compose.yml helped to solve this problem:

database:
  image: mysql:latest
  container_name: mysql_0
  ports:
    - "3306:3306"
  security_opt:
    - seccomp:unconfined