docker pull elasticsearch:7.4.2
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node"\
-e ES_JAVA_OPTS="-Xms64m -Xmx128m"\
-v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml\
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data\
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins\
-d elasticsearch:7.4.2
注意:挂载的目录必须都是可读可写可执行的文件 chmod -R 777