构建镜像
由于elasticsearch官方镜像仓库在国内因不可抗因素无法下载, 因此在daocloud上创建CI同步镜像仓库
镜像需要提前安装好分词(analysis-ik)附件(ingest-attachment)插件
目录结构
es
├── Dockerfile
├── elasticsearch-analysis-ik-6.1.4.zip
└── ingest-attachment-6.1.4.zip
Dockerfile
FROM daocloud.io/zhengtb/elasticsearch-oss:6.1.4
MAINTAINER zhengtb@jfbrother.com
COPY elasticsearch-analysis-ik-6.1.4.zip /usr/share/elasticsearch/bin/
COPY ingest-attachment-6.1.4.zip /usr/share/elasticsearch/bin/
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install file:///usr/share/elasticsearch/bin/elasticsearch-analysis-ik-6.1.4.zip
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install file:///usr/share/elasticsearch/bin/ingest-attachment-6.1.4.zip
RUN rm -f /usr/share/elasticsearch/bin/elasticsearch-analysis-ik-6.1.4.zip /usr/share/elasticsearch/bin/ingest-attachment-5.1.4.zip
制作镜像
# docker build -t elastic-search-oss-ik-attachment:6.1.4 .
启动服务
# docker run -d -p 9200:9200 -p 9300:9300 --name "es" -v "/usr/local/docker/elasticsearch/esdatadir":/usr/share/elasticsearch/data elastic-search-oss-ik-attachment:6.1.4
# docker run --name kibana -e ELASTICSEARCH_URL=http://es:9200 -p 5601:5601 -d daocloud.io/zhengtb/kibana-oss:6.1.4