步骤: 1.在虚拟机目录下新建docker-compose.yml文件,然后进入yml文件编辑 vi docker-compose.yml 2.在yml文件中添加如下代码: version: 3.1 services: elasticsearch: image: daocloud.io/library/elasticsearch:6.5.4 restart: always container_name: elasticsearch ports: - 9200:9200 #将分词器映射到容器内部 volumes: - ./ik:/usr/shar