Build elasticsearch cluster use docker,how config the memory in docker container?

I have use docker to build elasticsearch cluster, when build the container, must config the memory of container by –memory.
I know es‘s jvm must half of the container, and less than 32g. The lucene will use the other memory in container in buffer/cache.

So, in the docker container how many memeory could config, if the es‘s jvm config 32g,the container must config more than 64g (the machine have enough memory)?

I know docker use cgroup,but i don’t know cgroup whether limit the buffer/cache

Source: StackOverflow