From cc5c68896d34876d261e16e828667d7acb3d9b75 Mon Sep 17 00:00:00 2001 From: rick Date: Thu, 20 May 2021 14:22:03 +0800 Subject: [PATCH] Fix the server http://central.maven.org is down error Signed-off-by: rick --- .gitignore | 1 + java/blocks/jmxexporter/install.dck | 2 +- java/blocks/jolokia/install.dck | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 java/blocks/jolokia/install.dck diff --git a/.gitignore b/.gitignore index d900873..9ae1f89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store old .idea +java/images # generated by fish-pepper diff --git a/java/blocks/jmxexporter/install.dck b/java/blocks/jmxexporter/install.dck index e83dfd0..56c1df1 100644 --- a/java/blocks/jmxexporter/install.dck +++ b/java/blocks/jmxexporter/install.dck @@ -3,7 +3,7 @@ var globalVersions = fp.version || {}; var jmxExporterVersion = fp.blockOpts.version || globalVersions.jmxexporter || "0.10"; var jmxExporterArtifact = fp.blockOpts.jmxExporterArtifact || "jmx_prometheus_javaagent"; - var mavenRepo = fp.blockOpts.mavenRepo || "http://central.maven.org/maven2"; + var mavenRepo = fp.blockOpts.mavenRepo || "https://repo1.maven.org/maven2"; var userGroupMode = fp.blockOpts.userGroupMode; }}# Prometheus JMX exporter agent RUN mkdir -p /opt/prometheus/etc \ diff --git a/java/blocks/jolokia/install.dck b/java/blocks/jolokia/install.dck new file mode 100644 index 0000000..1f23c1a --- /dev/null +++ b/java/blocks/jolokia/install.dck @@ -0,0 +1,19 @@ +{{ + var destPath = fp.blockOpts.dest || "/bin/jolokia-options"; + var globalVersions = fp.version || {}; + var jolokiaVersion = fp.blockOpts.version || globalVersions.jolokia || "1.5.0"; + var jolokiaArtifact = jolokiaVersion.match(/^2.*$/) ? "jolokia-agent-jvm" : "jolokia-jvm"; + var mavenRepo = fp.blockOpts.mavenRepo || "https://repo1.maven.org/maven2"; + var userGroupMode = fp.blockOpts.userGroupMode; +}}# Jolokia agent +RUN mkdir -p /opt/jolokia/etc \ + && curl {{= mavenRepo }}/org/jolokia/{{= jolokiaArtifact }}/{{= jolokiaVersion }}/{{= jolokiaArtifact }}-{{= jolokiaVersion }}-agent.jar \ + -o /opt/jolokia/jolokia.jar +ADD jolokia-opts {{= destPath }} +RUN chmod 444 /opt/jolokia/jolokia.jar \ + && chmod 755 {{= destPath}} \{{? userGroupMode }} + && chmod 775 /opt/jolokia/etc \ + && chgrp {{= userGroupMode }} /opt/jolokia/etc{{??}} + && chmod 755 /opt/jolokia/etc{{?}} + +EXPOSE 8778