Mem_limit and memswap_limit in docker-compose not used?

Probably a dum question, but when I do docker stats on my container, the memory limit seems stuck at 995.9 no matter what I put in for the docker-compose limits.
My docker-compose.yml looks like this:

Jenkins Slave

slave:
image: kenyee/android-swarm-jdk8:latest
mem_limit: 2g
memswap_limit: 5g
networks:
- jenkinsnet
env_file:
- jenkins-slave.env

and my docker stats on the slave container looks like this:
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
8331535a4d3d 0.10% 92.56 MiB / 995.9 MiB 9.29% 18.32 MB / 1.182 MB 4.096 kB / 17.32 MB 15

I’m running on the latest docker toolbox on OSX if that matters.

Figured it out…docker-toolbox runs on Virtualbox on OSX.
The max memory of each container is limited to how much memory you allocate Virtualbox.
Bumped it from the default of 1GB to 2GB and I have 2GB for my mem limit in the VM now :slight_smile: