下载sentinel官方jar包
从github.com/alibaba/Sen… 下载dashboard的jar文件
wget https://github.com/alibaba/Sentinel/releases/download/1.8.8/sentinel-dashboard-1.8.8.jar
创建Dockerfile
FROM openjdk:8-jre
MAINTAINER yh
COPY ./sentinel-dashboard-*.jar /app.jar
EXPOSE 8718
ENTRYPOINT ["java", "-jar", "app.jar"]
创建sentinel镜像
docker build -t sentinel:1.0 .
创建docker-compose.yml文件
version: '3.9'
services:
sentinel:
image: sentinel:1.0
container_name: sentinel
ports:
- "8718:8718"
environment:
JVM_OPTS: -server -Xmx512M -Xms512M -XX:MaxMetaspaceSize=256M -XX:CompressedClassSpaceSize=50M -XX:ReservedCodeCacheSize=240M -XX:MaxDirectMemorySize=400M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "1"
volumes:
- "/docker/alibaba/sentinel/logs:/root/logs"
- "/docker/alibaba/sentinel/logs:/app-logs"
command: [
"--server.port=8718",
"--logging.file.path=/app-logs"
]
restart: always
network_mode: "host"
启动sentinel
docker-compose up -d
登录sentinel
启动后可以通过IP:8718访问控制台,控制台账号密码默认都是sentinel