run elasticsearch from docker on ec2

im trying to start a elasticsearch instance for dev porpuse(the smallest possible , dont care), is inside ec2 t2.micro (in order to avoid cost running the elasticsearch service from aws)

so … i pulled the instance

docker pull

enter image description here

now , when i try to run the image

docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node"

the following error apperars

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) 

    failed; error='Not enough space' (errno=12)
    # There is insufficient memory for the Java Runtime Environment to continue.
    # Native memory allocation (mmap) failed to map 1073741824 bytes for committing reserved memory.
    # An error report file with more information is saved as:
    # logs/hs_err_pid1.log

i heard in some places that you have two options
Either give more memory to your VM (is this posible for a t2.micro instance), how can achive that?
or change Elasticsearch JVM settings/etc/elasticsearch/jvm.options and lower the values of the following parameters -Xms512m -Xmx512m but how can i do this if i the image its not available to get in

i also tried to install elasticserach via rpm but requires coreutils >= 8.4 , so another failure trying to get the instance up

using -Xms512m -Xmx512m on jvm.options with avaible space (i guess)
i got the same error Not enough space
enter image description here

Source: StackOverflow