未验证 提交 fc196efd 编写于 作者: K kezhenxu94 提交者: GitHub

chore: build `swctl` from CLI Docker image instead of building from source (#7958)

上级 ca539e7d
......@@ -20,7 +20,7 @@ SW_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
CONTEXT ?= ${SW_ROOT}/dist
SKIP_TEST ?= false
DIST ?= apache-skywalking-apm-bin.tar.gz
CLI_VERSION ?= 0.7.0 # CLI version inside OAP image should always use an Apache released artifact.
CLI_VERSION ?= 0.9.0 # CLI version inside OAP image should always use an Apache released artifact.
init:
cd $(SW_ROOT) && git submodule update --init --recursive
......
......@@ -16,84 +16,9 @@
ARG BASE_IMAGE='adoptopenjdk/openjdk11:alpine'
FROM $BASE_IMAGE as cli
ARG SKYWALKING_CLI_VERSION
WORKDIR /skywalking
ARG SKYWALKING_CLI_VERSION=0.7.0
ENV SKYWALKING_CLI_TGZ=skywalking-cli-$SKYWALKING_CLI_VERSION-bin.tgz
ENV SKYWALKING_CLI_ASC=${SKYWALKING_CLI_TGZ}.asc
ENV SKYWALKING_CLI_SHA512=${SKYWALKING_CLI_TGZ}.sha512
ENV SKYWALKING_CLI_TGZ_URLS \
https://www.apache.org/dyn/closer.cgi?action=download&filename=skywalking/cli/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_TGZ \
# if the version is outdated, we might have to pull from the dist/archive :/
https://www-us.apache.org/dist/skywalking/cli/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_TGZ \
https://www.apache.org/dist/skywalking/cli/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_TGZ \
https://archive.apache.org/dist/skywalking/cli/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_TGZ
ENV SKYWALKING_CLI_ASC_URLS \
https://www.apache.org/dyn/closer.cgi?action=download&filename=skywalking/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_ASC \
# if the version is outdated, we might have to pull from the dist/archive :/
https://www-us.apache.org/dist/skywalking/cli/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_ASC \
https://www.apache.org/dist/skywalking/cli/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_ASC \
https://archive.apache.org/dist/skywalking/cli/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_ASC
ENV SKYWALKING_CLI_SHA512_URLS \
https://www.apache.org/dyn/closer.cgi?action=download&filename=skywalking/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_SHA512 \
# if the version is outdated, we might have to pull from the dist/archive :/
https://www-us.apache.org/dist/skywalking/cli/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_SHA512 \
https://www.apache.org/dist/skywalking/cli/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_SHA512 \
https://archive.apache.org/dist/skywalking/cli/$SKYWALKING_CLI_VERSION/$SKYWALKING_CLI_SHA512
RUN set -eux; \
\
apk add --no-cache --virtual .fetch-deps \
gnupg \
ca-certificates \
openssl \
; \
\
wget --timeout=20 -O KEYS https://downloads.apache.org/skywalking/KEYS; \
gpg --import KEYS; \
\
success=; \
for url in $SKYWALKING_CLI_TGZ_URLS; do \
if wget --timeout=20 -O ${SKYWALKING_CLI_TGZ} "$url"; then \
success=1; \
break; \
fi; \
done; \
[ -n "$success" ]; \
\
success=; \
for url in $SKYWALKING_CLI_SHA512_URLS; do \
if wget --timeout=20 -O ${SKYWALKING_CLI_SHA512} "$url"; then \
success=1; \
break; \
fi; \
done; \
[ -n "$success" ]; \
\
sha512sum -c ${SKYWALKING_CLI_SHA512}; \
\
success=; \
for url in $SKYWALKING_CLI_ASC_URLS; do \
if wget --timeout=20 -O ${SKYWALKING_CLI_ASC} "$url"; then \
success=1; \
break; \
fi; \
done; \
[ -n "$success" ]; \
\
gpg --batch --verify ${SKYWALKING_CLI_ASC} ${SKYWALKING_CLI_TGZ}; \
tar -xvf ${SKYWALKING_CLI_TGZ}; \
mkdir "bin/"; \
mv skywalking-cli-${SKYWALKING_CLI_VERSION}-bin/bin/swctl-${SKYWALKING_CLI_VERSION}-linux-amd64 bin/swctl; \
chmod 755 bin/*; \
command -v gpgconf && gpgconf --kill all || :; \
ls -la .;
FROM apache/skywalking-cli:$SKYWALKING_CLI_VERSION as cli
FROM $BASE_IMAGE
......@@ -116,7 +41,7 @@ RUN set -ex; \
rm -rf "agent"; \
mkdir "bin";
COPY --from=cli /skywalking/bin/swctl ./bin
COPY --from=cli /swctl ./bin
COPY log4j2.xml config/
COPY docker-entrypoint.sh .
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册