-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6cb290c
commit aeea73d
Showing
3 changed files
with
73 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
ARG VERSION | ||
FROM debian:bullseye-slim as clickhouse | ||
ARG TARGETARCH | ||
|
||
ARG DEPENDENCIES=" \ | ||
ca-certificates \ | ||
curl" | ||
|
||
ARG APT_MIRROR=http://mirrors.ustc.edu.cn | ||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=koko-apt \ | ||
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=koko-apt \ | ||
sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \ | ||
&& rm -f /etc/apt/apt.conf.d/docker-clean \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends ${DEPENDENCIES} \ | ||
&& LATEST_VERSION=$(curl -s https://packages.clickhouse.com/tgz/stable/ | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sort -V -r | head -n 1) \ | ||
&& PKG="clickhouse-common-static" \ | ||
&& \ | ||
case "${TARGETARCH}" in \ | ||
amd64|arm64) \ | ||
mkdir -p /opt/clickhouse; \ | ||
curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$LATEST_VERSION-${TARGETARCH}.tgz"; \ | ||
tar -xf "$PKG-$LATEST_VERSION-${TARGETARCH}.tgz" -C /opt/clickhouse --strip-components=1; \ | ||
rm -f "$PKG-$LATEST_VERSION-${TARGETARCH}.tgz"; \ | ||
;; \ | ||
*) \ | ||
mkdir -p /opt/clickhouse/usr/bin; \ | ||
echo > /opt/clickhouse/usr/bin/clickhouse; \ | ||
;; \ | ||
esac \ | ||
&& chown -R root:root /opt/clickhouse | ||
|
||
FROM registry.fit2cloud.com/jumpserver/koko-ce:${VERSION} | ||
|
||
COPY --from=clickhouse /opt/clickhouse/usr/bin/clickhouse /usr/local/bin/clickhouse-client | ||
|