Skip to content

Instantly share code, notes, and snippets.

@vicenterusso
Last active November 12, 2023 13:33
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vicenterusso/ae6d6c903b790e5dae91c339c1ce2ba8 to your computer and use it in GitHub Desktop.
Save vicenterusso/ae6d6c903b790e5dae91c339c1ce2ba8 to your computer and use it in GitHub Desktop.
Docker Compose with fix Fedora 35/36/37 MySQL container - Leak Memory - High Usage - Error code 137
version: '3'
services:
mysqldb:
image: mysql:5.7.22
container_name: mysql_container_name
restart: always
ulimits:
nproc: 65535
nofile:
soft: 20000
hard: 40000
volumes:
- "./data:/var/lib/mysql"
@vicenterusso
Copy link
Author

@rulrok
Copy link

rulrok commented Jun 3, 2022

It just works 🚀

@nguyenhai97
Copy link

Confirm this work on F36

@carlosjs23
Copy link

Thanks it works in a new F36 install, weird that my previous F36 didn't have this issue.

@binary-data
Copy link

Works on Fedora 36, mysql 5.7 was able to start

@adammigaczdevqube
Copy link

Working fix for the issue Fedora 37, mysql 5.7

Client: Docker Engine - Community
 Version:           20.10.21
 API version:       1.41
 Go version:        go1.18.7
 Git commit:        baeda1f
 Built:             Tue Oct 25 18:02:36 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.21
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.7
  Git commit:       3056208
  Built:            Tue Oct 25 18:00:17 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.12
  GitCommit:        a05d175400b1145e5e6a735a6710579d181e7fb0
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

@xvladqt
Copy link

xvladqt commented Feb 14, 2023

Thanks, this fix memory usage on my desktop too, linux-zen arch

@Schnouki
Copy link

Works for me too on Linux-zen 6.1.12 on Arch Linux. Thanks!

@Andersgee
Copy link

Thanks

This is also in compose-file documentation but is not really mentioned as a problem fix.

Also, I want to add that this fix is not specifically Fedora related, but rather any system with bad/unlimited default ulimits, since the container just inherits them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment