参考:https://juejin.im/post/5ca0d12c518825550b35be6d

    1. # 拉取镜像
    2. docker pull elasticsearch:6.3.2
    3. # 创建es目录
    4. mkdir -p ~/es6.3.2/data #数据存放地方
    5. mkdir ~/es6.3.2/config # 配置存放地方
    6. mkdir ~/es6.3.2/plugins # 插件存放的地方
    7. # es配置文件
    8. touch ~/es6.3.2/config/elasticsearch.yml
    9. vim ~/es6.3.2/config/elasticsearch.yml
    10. cluster.name: es_log
    11. network.bind_host: 0.0.0.0
    12. http.port: 9200
    13. transport.tcp.port: 9300
    14. http.cors.enabled: true
    15. http.cors.allow-origin: "*"
    16. docker run \
    17. -e ES_JAVA_OPTS="-Xms10g -Xmx10g" \
    18. -d -p 9200:9200 -p 9300:9300 \
    19. -v /home/worker/es6.3.2/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
    20. -v /home/worker/es6.3.2/plugins:/usr/share/elasticsearch/plugins \
    21. -v /home/worker/es6.3.2/data:/usr/share/elasticsearch/data \
    22. --name es_log elasticsearch:6.3.2
    23. # head
    24. docker pull mobz/elasticsearch-head:5
    25. docker run -di --name=es_head -p 9100:9100 mobz/elasticsearch-head:5
    26. # kibana
    27. docker pull kibana:6.3.2
    28. docker run --link es_log:elasticsearch -p 5601:5601 --name kibana -d kibana:6.3.2
    29. docker镜像移动
    30. 1、打包
    31. sudo docker save -o golang:alpine3.7 ./
    32. 2、引入包
    33. docker load < my-golang-alpine3.7.tar