Install the latest Elasticsearch
docker pull elasticsearch
Because elasticsearch is written in java, it occupies 2G of memory space when started by default, so we need to configure the running memory before starting
docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m"
-d -p 9200:9200 -p 9300:9300 --name ES01 id
Where id is the IMAGE ID, check
whether the startup is successful through docker images query
docker ps
As follows (i.e. success)