Indeed, -1 should be unlimited, so that the container will keep all allocated memory in ram.
But since a resource limit is set, the container will be OOM killed if the memory usage passes the limit.
ES is implemented in Java, which (if a recent enough Java JVM is used) respects CGROUP ressource limits and as such behaves like “the system” (from the container pov) only has 1gb. It influences how much memory java actually allocates and uses. if you experience an OOM kill, you might want to raise the memory limit until you find a sweat spot.