先拉取镜像
docker pull docker.elastic.co/elasticsearch/elasticsearch:6.7.1 然后创建容器 (这是一条长的命令!!!) docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.7.1