Running docker run -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -it --rm elasticsearch:5 -E es.bootstrap.seccomp=false should start elasticsearch.
Actual behavior
The docker image starts but elasticsearch fails with Exception in thread "main" java.lang.RuntimeException: bootstrap checks failed max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
docker run --privileged is probably the easiest way (remember, all containers share the same kernel and so the same sysctl settings, but I think you need to be --privileged to change them).
There’s also a magic screen command that can get a shell on the VM console, but this is bulkier and harder to script. It’s been mentioned on the forum several times.
If i’m not mistaken you can set the vm.max_map_count via these settings. I think I even did it a month ago but I can’t remember how I did it or where I found how to do it.