1.在es01同级目录创建kibana文件夹
mkdir es-head
2.编写docker-compose.yml
version: '3'
services:
es-head:
build:
context: .
dockerfile: Dockerfile
image: mobz/elasticsearch-head:5
container_name: es-head
privileged: true
environment:
- TZ=Asia/Shanghai
restart: always
ports:
- "9100:9100"
# volumes:
# - /data/es-head:/usr/src/app:rw
networks:
- es-net
networks:
es-net:
external: true
3.编写Dockerfile
FROM mobz/elasticsearch-head:5
MAINTAINER Niko Bellic <niko.bellic@kakaocorp.com>
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN npm install -g grunt
#COPY package.json /usr/src/app/package.json
#RUN npm install
#COPY ./* /usr/src/app/
EXPOSE 9100
CMD grunt server
一键启动
docker-compose up -d
查看启动是否正常
docker ps
4.copy文件
docker cp -a kibana:/usr/src/app/* .
5.修改配置文件
取消docker-compose.yml注释部分,即去掉 #
取消Dockerfile注释部分,即去掉 #
修改Gruntfile.js(将host,port替换下面的)
connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 9100,
base: '.',
keepalive: true
}
}
}
6.迭代启动
迭代镜像启动
在网页输入url:172.23.165.185:5601
输入账号密码
在输入框输入
http://elastic:密码@172.23.165.185:9200/
即可查看索引信息