From b5280daa6d0de0510459c008c34515b7318ed4e1 Mon Sep 17 00:00:00 2001 From: Wilson Wu Date: Wed, 23 Nov 2022 15:40:43 +0800 Subject: [PATCH 1/4] Add dockerfile for dashboard with doc update --- Dockerfile | 25 +++++++++++++++++++++++++ README.md | 6 ++++++ 2 files changed, 31 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..a9fcf7bc92 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM amd64/buildpack-deps:buster-curl as installer + +ARG SENTINEL_VERSION +ARG HOT_FIX_FLAG="" + +RUN set -x \ + && curl -SL --output /var/tmp/sentinel-dashboard.jar https://github.com/alibaba/Sentinel/releases/download/${SENTINEL_VERSION}/sentinel-dashboard-${SENTINEL_VERSION}.jar \ + && cp /var/tmp/sentinel-dashboard.jar /home \ + && rm -rf /var/tmp/sentinel-dashboard.jar + +FROM openjdk:8-jre-slim + +WORKDIR $BASE_DIR + +# copy nacos bin +COPY --from=installer ["/home/sentinel-dashboard.jar", "/home/sentinel-dashboard.jar"] + +ENV JAVA_OPTS '-Dserver.port=8080 -Dcsp.sentinel.dashboard.server=localhost:8080' + +RUN chmod -R +x /home/sentinel-dashboard.jar + +EXPOSE 8080 + +CMD java ${JAVA_OPTS} -jar /home/sentinel-dashboard.jar + diff --git a/README.md b/README.md index 8e5fdf5a6d..c867c9259b 100755 --- a/README.md +++ b/README.md @@ -140,6 +140,12 @@ Sentinel also provides a simple dashboard application, on which you can monitor For details please refer to [Dashboard](https://github.com/alibaba/Sentinel/wiki/Dashboard). +### 6. Build Docker Image for Dashboard + +``` +docker build --build-arg SENTINEL_VERSION=1.8.6 -t ${REGISTRY}/sentinel-dashboard:v1.8.6 . +``` + ## Trouble Shooting and Logs Sentinel will generate logs for troubleshooting and real-time monitoring. From 4ea929446761a3d671ed8b22476aedbdab756f17 Mon Sep 17 00:00:00 2001 From: Wilson Wu Date: Fri, 25 Nov 2022 10:18:27 +0800 Subject: [PATCH 2/4] move dockfile to dashboard and update doc --- README.md | 6 ------ Dockerfile => sentinel-dashboard/Dockerfile | 0 sentinel-dashboard/README.md | 6 ++++++ 3 files changed, 6 insertions(+), 6 deletions(-) rename Dockerfile => sentinel-dashboard/Dockerfile (100%) diff --git a/README.md b/README.md index c867c9259b..8e5fdf5a6d 100755 --- a/README.md +++ b/README.md @@ -140,12 +140,6 @@ Sentinel also provides a simple dashboard application, on which you can monitor For details please refer to [Dashboard](https://github.com/alibaba/Sentinel/wiki/Dashboard). -### 6. Build Docker Image for Dashboard - -``` -docker build --build-arg SENTINEL_VERSION=1.8.6 -t ${REGISTRY}/sentinel-dashboard:v1.8.6 . -``` - ## Trouble Shooting and Logs Sentinel will generate logs for troubleshooting and real-time monitoring. diff --git a/Dockerfile b/sentinel-dashboard/Dockerfile similarity index 100% rename from Dockerfile rename to sentinel-dashboard/Dockerfile diff --git a/sentinel-dashboard/README.md b/sentinel-dashboard/README.md index ad8b91f966..e3597725df 100755 --- a/sentinel-dashboard/README.md +++ b/sentinel-dashboard/README.md @@ -58,4 +58,10 @@ java -Dserver.port=8080 \ 客户端正确配置并启动后,会**在初次调用后**主动向控制台发送心跳包,汇报自己的存在; 控制台收到客户端心跳包之后,会在左侧导航栏中显示该客户端信息。如果控制台能够看到客户端的机器信息,则表明客户端接入成功了。 +## 6. 构建Docker镜像 + +``` +docker build --build-arg SENTINEL_VERSION=1.8.6 -t ${REGISTRY}/sentinel-dashboard:v1.8.6 . +``` + 更多:[控制台功能介绍](./Sentinel_Dashboard_Feature.md)。 \ No newline at end of file From a9acca5c56bcbe00e57f163bcdf8f9d7deff5780 Mon Sep 17 00:00:00 2001 From: Wilson Wu Date: Fri, 25 Nov 2022 13:08:24 +0800 Subject: [PATCH 3/4] fix and clean dockerfile --- sentinel-dashboard/Dockerfile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sentinel-dashboard/Dockerfile b/sentinel-dashboard/Dockerfile index a9fcf7bc92..e8d67c026f 100644 --- a/sentinel-dashboard/Dockerfile +++ b/sentinel-dashboard/Dockerfile @@ -1,18 +1,13 @@ FROM amd64/buildpack-deps:buster-curl as installer ARG SENTINEL_VERSION -ARG HOT_FIX_FLAG="" RUN set -x \ - && curl -SL --output /var/tmp/sentinel-dashboard.jar https://github.com/alibaba/Sentinel/releases/download/${SENTINEL_VERSION}/sentinel-dashboard-${SENTINEL_VERSION}.jar \ - && cp /var/tmp/sentinel-dashboard.jar /home \ - && rm -rf /var/tmp/sentinel-dashboard.jar + && curl -SL --output /home/sentinel-dashboard.jar https://github.com/alibaba/Sentinel/releases/download/${SENTINEL_VERSION:-1.8.6}/sentinel-dashboard-${SENTINEL_VERSION:-1.8.6}.jar FROM openjdk:8-jre-slim -WORKDIR $BASE_DIR - -# copy nacos bin +# copy sentinel jar COPY --from=installer ["/home/sentinel-dashboard.jar", "/home/sentinel-dashboard.jar"] ENV JAVA_OPTS '-Dserver.port=8080 -Dcsp.sentinel.dashboard.server=localhost:8080' From 5876649e4efb86cb42ab1e09d2730d97470f2013 Mon Sep 17 00:00:00 2001 From: Wilson Wu Date: Fri, 25 Nov 2022 16:13:32 +0800 Subject: [PATCH 4/4] update default version value logic --- sentinel-dashboard/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sentinel-dashboard/Dockerfile b/sentinel-dashboard/Dockerfile index e8d67c026f..3a3412db23 100644 --- a/sentinel-dashboard/Dockerfile +++ b/sentinel-dashboard/Dockerfile @@ -1,9 +1,9 @@ FROM amd64/buildpack-deps:buster-curl as installer -ARG SENTINEL_VERSION +ARG SENTINEL_VERSION=1.8.6 RUN set -x \ - && curl -SL --output /home/sentinel-dashboard.jar https://github.com/alibaba/Sentinel/releases/download/${SENTINEL_VERSION:-1.8.6}/sentinel-dashboard-${SENTINEL_VERSION:-1.8.6}.jar + && curl -SL --output /home/sentinel-dashboard.jar https://github.com/alibaba/Sentinel/releases/download/${SENTINEL_VERSION}/sentinel-dashboard-${SENTINEL_VERSION}.jar FROM openjdk:8-jre-slim