Skip to content

Commit ca2d062

Browse files
committed
update Dockerfile-No-Jdk
1 parent f672ae8 commit ca2d062

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Dockerfile-No-Jdk

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
FROM alpine
1+
# Stage 1: Build
2+
FROM openjdk:8-jdk-alpine AS builder
23

34
ARG ARTHAS_VERSION="4.0.1"
45
ARG MIRROR=false
5-
66
ENV MAVEN_HOST=https://repo1.maven.org/maven2 \
77
MIRROR_MAVEN_HOST=https://maven.aliyun.com/repository/public
88

99
# if use mirror change to aliyun mirror site
10-
RUN if $MIRROR; then MAVEN_HOST=${MIRROR_MAVEN_HOST} ; fi && \
10+
RUN if [ "$MIRROR" = "true" ]; then MAVEN_HOST=${MIRROR_MAVEN_HOST} ; fi && \
1111
# download & install arthas
1212
wget -qO /tmp/arthas.zip "${MAVEN_HOST}/com/taobao/arthas/arthas-packaging/${ARTHAS_VERSION}/arthas-packaging-${ARTHAS_VERSION}-bin.zip" && \
1313
mkdir -p /opt/arthas && \
1414
unzip /tmp/arthas.zip -d /opt/arthas && \
1515
rm /tmp/arthas.zip
16+
17+
# Stage 2: Final
18+
FROM alpine
19+
20+
COPY --from=builder /opt/arthas /opt/arthas

0 commit comments

Comments
 (0)