From 948cebf22125146bd5799df84e3ec0002c918eaa Mon Sep 17 00:00:00 2001 From: MartinDai Date: Mon, 18 Mar 2024 17:36:00 +0800 Subject: [PATCH 1/3] fix dockerfile base image manifest unknown --- src/main/docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile index 792939a..b593ee4 100644 --- a/src/main/docker/Dockerfile +++ b/src/main/docker/Dockerfile @@ -15,8 +15,8 @@ # limitations under the License. # -FROM java:8 +FROM openjdk:8-alpine MAINTAINER breeze -ADD rocketmq-exporter-0.0.2-SNAPSHOT-exec.jar rocketmq-exporter.jar +ADD rocketmq-exporter-0.0.3-SNAPSHOT-exec.jar rocketmq-exporter.jar EXPOSE 5557 ENTRYPOINT ["java","-jar","rocketmq-exporter.jar"] From 58469cc1683e230ba806ce27b71e0ef15c51b9cf Mon Sep 17 00:00:00 2001 From: MartinDai Date: Tue, 28 May 2024 19:20:34 +0800 Subject: [PATCH 2/3] fix checkstyle --- .../org/apache/rocketmq/exporter/task/MetricsCollectTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/rocketmq/exporter/task/MetricsCollectTask.java b/src/main/java/org/apache/rocketmq/exporter/task/MetricsCollectTask.java index e2e5f00..d8d84d2 100644 --- a/src/main/java/org/apache/rocketmq/exporter/task/MetricsCollectTask.java +++ b/src/main/java/org/apache/rocketmq/exporter/task/MetricsCollectTask.java @@ -716,7 +716,7 @@ public void collectBrokerGroupStats() { String brokerName = clusterEntry.getValue().getBrokerName(); String masterAddr = clusterEntry.getValue().getBrokerAddrs().get(MixAll.MASTER_ID); for (Map.Entry broker : clusterEntry.getValue().getBrokerAddrs().entrySet()) { - if(broker.getKey() == MixAll.MASTER_ID) { + if (broker.getKey() == MixAll.MASTER_ID) { continue; } BrokerRuntimeStats slaveRuntimeStats = getBrokerRuntimeStats(broker.getValue()); From 8685c2ffaeb0f297dd9967790bfdfc0aeded0ccf Mon Sep 17 00:00:00 2001 From: MartinDai Date: Mon, 3 Jun 2024 15:00:00 +0800 Subject: [PATCH 3/3] optimize docker image build --- pom.xml | 7 +++++-- src/main/docker/Dockerfile | 22 ---------------------- 2 files changed, 5 insertions(+), 24 deletions(-) delete mode 100644 src/main/docker/Dockerfile diff --git a/pom.xml b/pom.xml index a791cf6..e769f23 100644 --- a/pom.xml +++ b/pom.xml @@ -227,6 +227,7 @@ under the License. + ${project.artifactId}-${project.version} @@ -485,7 +486,7 @@ under the License. com.spotify docker-maven-plugin - 0.4.11 + 1.2.2 javax.activation @@ -496,11 +497,13 @@ under the License. ${docker.image.prefix}/${project.artifactId} + openjdk:8-alpine + / ${project.version} latest - src/main/docker + ["java", "-jar", "${project.build.finalName}-exec.jar"] / diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile deleted file mode 100644 index b593ee4..0000000 --- a/src/main/docker/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -FROM openjdk:8-alpine -MAINTAINER breeze -ADD rocketmq-exporter-0.0.3-SNAPSHOT-exec.jar rocketmq-exporter.jar -EXPOSE 5557 -ENTRYPOINT ["java","-jar","rocketmq-exporter.jar"]