I have memswap_limit in my docker-compose file (version 2) and I want to change my docker-compose file on version 3. But I don't found how to replace memswap_limit.
I saw advices like "To configure resource constraints. This replaces the older resource constraint options in Compose files prior to version 3 (cpu_shares, cpu_quota, cpuset, mem_limit, memswap_limit)."
My docker-compose.yml file (version 2)
db:
image: postgres:alpine
mem_limit: 512m
memswap_limit: 512m
Agree with @BlackVegetable. After updating to V3 memswap_limit is no longer there, people submitted ticket to docker github, hopefully it would bring it back. I just did a little investigation and it is still unsupported.
For now maybe be aware of there would be swap memory and inspect docker container, which would show you the memory and swap memory
From Docker website:
If --memory-swap is unset, and --memory is set, the container can use twice as much swap as the --memory setting, if the host container has swap memory configured. For instance, if --memory="300m" and --memory-swap is not set, the container can use 300m of memory and 600m of swap.
Or you can do the docker run command instead of the docker compose.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With