参考:https://juejin.im/post/5ca0d12c518825550b35be6d
# 拉取镜像
docker pull elasticsearch:6.3.2
# 创建es目录
mkdir -p ~/es6.3.2/data #数据存放地方
mkdir ~/es6.3.2/config # 配置存放地方
mkdir ~/es6.3.2/plugins # 插件存放的地方
# es配置文件
touch ~/es6.3.2/config/elasticsearch.yml
vim ~/es6.3.2/config/elasticsearch.yml
cluster.name: es_log
network.bind_host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
http.cors.enabled: true
http.cors.allow-origin: "*"
docker run \
-e ES_JAVA_OPTS="-Xms10g -Xmx10g" \
-d -p 9200:9200 -p 9300:9300 \
-v /home/worker/es6.3.2/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /home/worker/es6.3.2/plugins:/usr/share/elasticsearch/plugins \
-v /home/worker/es6.3.2/data:/usr/share/elasticsearch/data \
--name es_log elasticsearch:6.3.2
# head
docker pull mobz/elasticsearch-head:5
docker run -di --name=es_head -p 9100:9100 mobz/elasticsearch-head:5
# kibana
docker pull kibana:6.3.2
docker run --link es_log:elasticsearch -p 5601:5601 --name kibana -d kibana:6.3.2
docker镜像移动
1、打包
sudo docker save -o golang:alpine3.7 ./
2、引入包
docker load < my-golang-alpine3.7.tar