由于未在cerebro
官方查询到关于TLS/SSL的相关配置说明,因此基于官方Dockerfile文件自定义Docker镜像
证书制作请参见官方文档
mkdir -p /path/to/save/cerebro # 目录根据实际情况进行相应修改
cd /path/to/save/cerebro
mkdir certs
cp /path/to/save/certs/ca.crt certs/ # 证书存放目录根据实际情况进行修改
vim Dockerfile
Dockerfile 文件内容如下:
FROM openjdk:11-jre-slim
ENV CEREBRO_VERSION 0.9.3
RUN apt-get update \
&& apt-get install -y wget \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /opt/cerebro/logs \
&& wget -qO- https://github.com/lmenezes/cerebro/releases/download/v${CEREBRO_VERSION}/cerebro-${CEREBRO_VERSION}.tgz \
| tar xzv --strip-components 1 -C /opt/cerebro \
&& sed -i '/<appender-ref ref="FILE"\/>/d' /opt/cerebro/conf/logback.xml \
&& addgroup -gid 1000 cerebro \
&& adduser -gid 1000 -uid 1000 cerebro \
&& chown -R cerebro:cerebro /opt/cerebro
WORKDIR /opt/cerebro
COPY certs/ca.crt /opt/cerebro
RUN keytool -importcert -file ca.crt -alias esca -cacerts -storepass changeit -noprompt
USER cerebro
ENTRYPOINT [ "/opt/cerebro/bin/cerebro" ]
docker build -t custom/cerebro:0.9.3 # custom根据实际情况进行相应修改
version: '2.2'
services:
cerero:
image: navnow/cerebro:0.9.3
container_name: cerebro
environment:
- AUTH_TYPE=basic
- BASIC_AUTH_USER=user_name
- BASIC_AUTH_PWD=password
ports:
- "9000:9000"
command:
- -Dhosts.0.host=https://esnode01:9200
networks:
- elastic
...
该片段内容仅为docker-compose.yml关于cerebro部分的内容,其他请根据实际情况进行编写
BASIC_AUTH_USER
和BASIC_AUTH_PWD
后面的值请根据实际情况进行修改
以上全文