From 73ae8ace38aaee23019a6f1845766acee9af8818 Mon Sep 17 00:00:00 2001 From: AnJia Date: Thu, 20 Dec 2018 17:02:17 +0800 Subject: [PATCH 1/3] arthas version use --build-arg default 3.0.5 ``` docker build --build-arg ARTHAS_VERSION=3.0.3 . -t xxxx ``` --- Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 795a5df6f..8eca782e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,16 @@ FROM openjdk:8-jdk-alpine +MAINTAINER arthas anjia0532 + +ARG ARTHAS_VERSION="3.0.5" + # https://github.com/docker-library/openjdk/issues/76 RUN apk add --no-cache tini + # Tini is now available at /sbin/tini ENTRYPOINT ["/sbin/tini", "--"] -RUN wget -qO- -O /tmp/arthas.zip https://repo1.maven.org/maven2/com/taobao/arthas/arthas-packaging/3.0.5/arthas-packaging-3.0.5-bin.zip && mkdir -p /opt/arthas && unzip /tmp/arthas.zip -d /opt/arthas && rm /tmp/arthas.zip - +RUN wget -qO- -O /tmp/arthas.zip https://repo1.maven.org/maven2/com/taobao/arthas/arthas-packaging/${ARTHAS_VERSION}/arthas-packaging-${ARTHAS_VERSION}-bin.zip && \ + mkdir -p /opt/arthas && \ + unzip /tmp/arthas.zip -d /opt/arthas && \ + rm /tmp/arthas.zip From 7cf1e55b59521cda0777222ab8e6cd094288df7c Mon Sep 17 00:00:00 2001 From: AnJia Date: Thu, 20 Dec 2018 17:43:56 +0800 Subject: [PATCH 2/3] support aliyun mirror --- Dockerfile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8eca782e0..63c2aa132 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,14 +3,22 @@ FROM openjdk:8-jdk-alpine MAINTAINER arthas anjia0532 ARG ARTHAS_VERSION="3.0.5" +ARG MIRROR=false -# https://github.com/docker-library/openjdk/issues/76 -RUN apk add --no-cache tini +ENV MAVEN_HOST=https://repo1.maven.org/maven2 \ + ALPINE_HOST=dl-cdn.alpinelinux.org \ + MIRROR_MAVEN_HOST=http://maven.aliyun.com/repository/public \ + MIRROR_ALPINE_HOST=mirrors.aliyun.com + +# if use mirror change to aliyun mirror site +RUN if $MIRROR; then MAVEN_HOST=${MIRROR_MAVEN_HOST} ;ALPINE_HOST=${MIRROR_ALPINE_HOST} ; sed -i "s/dl-cdn.alpinelinux.org/${ALPINE_HOST}/g" /etc/apk/repositories ; fi && \ + # https://github.com/docker-library/openjdk/issues/76 + apk add --no-cache tini && \ + # download & install arthas + wget -qO /tmp/arthas.zip "${MAVEN_HOST}/com/taobao/arthas/arthas-packaging/${ARTHAS_VERSION}/arthas-packaging-${ARTHAS_VERSION}-bin.zip" && \ + mkdir -p /opt/arthas && \ + unzip /tmp/arthas.zip -d /opt/arthas && \ + rm /tmp/arthas.zip # Tini is now available at /sbin/tini ENTRYPOINT ["/sbin/tini", "--"] - -RUN wget -qO- -O /tmp/arthas.zip https://repo1.maven.org/maven2/com/taobao/arthas/arthas-packaging/${ARTHAS_VERSION}/arthas-packaging-${ARTHAS_VERSION}-bin.zip && \ - mkdir -p /opt/arthas && \ - unzip /tmp/arthas.zip -d /opt/arthas && \ - rm /tmp/arthas.zip From 9b152c7ca8321a4b2b08dbbca80feca099df1978 Mon Sep 17 00:00:00 2001 From: AnJia Date: Thu, 20 Dec 2018 17:45:08 +0800 Subject: [PATCH 3/3] delete MAINTAINER --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 63c2aa132..54b4e8e6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM openjdk:8-jdk-alpine -MAINTAINER arthas anjia0532 - ARG ARTHAS_VERSION="3.0.5" ARG MIRROR=false