要在Docker中构建并运行Sentinel Dashboard,您可以按照以下步骤操作:
1.下载jar
curl -o sentinel-dashboard.jar \
https://github.com/alibaba/Sentinel/releases/download/1.8.8/sentinel-dashboard-1.8.8.jar
2.创建Dockerfile文件
官网地址:https://github.com/alibaba/Sentinel/blob/1.8/sentinel-dashboard/Dockerfile
vi Dockerfile
FROM openjdk:8-jre-slim
VOLUME /tmp
ADD *.jar sentinel-dashboard.jar
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
ENTRYPOINT ["java", "-jar", "-Dserver.port=8080", "-Dcsp.sentinel.dashboard.server=localhost:8080", "-Dproject.name=sentinel-dashboard", "/sentinel-dashboard.jar"]
3.构建镜像文件
docker build -t sentinel-dashboard:v1.8.8 .
4.Docker运行sentinel-dashboard
docker run --name sentinel-dashboard --restart=always -p 8090:8080 -d sentinel-dashboard:v1.8.8
5.访问sentinel-dashboard
http://192.168.110.20:8090
用户名:sentinel
密码:sentinel