@@ -26,23 +26,12 @@ RUN sed -i "s|http://archive.ubuntu.com|${apt_archive}|g" /etc/apt/sources.list
2626 wget \
2727 && rm -rf /var/lib/apt/lists/* /var/cache/debconf /tmp/*
2828
29- ARG REPO_CHANNEL="stable"
30- ARG REPOSITORY="deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb ${REPO_CHANNEL} main"
31- ARG VERSION="25.2.2.39"
32- ARG PACKAGES="clickhouse-client clickhouse-server clickhouse-common-static"
33-
3429#docker-official-library:off
3530# The part between `docker-official-library` tags is related to our builds
3631
37- # set non-empty deb_location_url url to create a docker image
38- # from debs created by CI build, for example:
39- # docker build . --network host --build-arg version="21.4.1.6282" --build-arg deb_location_url="https://..." -t ...
40- ARG deb_location_url=""
41- ARG DIRECT_DOWNLOAD_URLS=""
32+ # NOTE (strtgbb): Removed install methods other than direct URL install to tidy the Dockerfile
4233
43- # set non-empty single_binary_location_url to create docker image
44- # from a single binary url (useful for non-standard builds - with sanitizers, for arm64).
45- ARG single_binary_location_url=""
34+ ARG DIRECT_DOWNLOAD_URLS=""
4635
4736ARG TARGETARCH
4837
@@ -58,64 +47,7 @@ RUN if [ -n "${DIRECT_DOWNLOAD_URLS}" ]; then \
5847 && rm -rf /tmp/* ; \
5948 fi
6049
61- # install from a web location with deb packages
62- RUN arch="${TARGETARCH:-amd64}" \
63- && if [ -n "${deb_location_url}" ]; then \
64- echo "installing from custom url with deb packages: ${deb_location_url}" \
65- && rm -rf /tmp/clickhouse_debs \
66- && mkdir -p /tmp/clickhouse_debs \
67- && for package in ${PACKAGES}; do \
68- { wget --progress=bar:force:noscroll "${deb_location_url}/${package}_${VERSION}_${arch}.deb" -P /tmp/clickhouse_debs || \
69- wget --progress=bar:force:noscroll "${deb_location_url}/${package}_${VERSION}_all.deb" -P /tmp/clickhouse_debs ; } \
70- || exit 1 \
71- ; done \
72- && dpkg -i /tmp/clickhouse_debs/*.deb \
73- && rm -rf /tmp/* ; \
74- fi
75-
76- # install from a single binary
77- RUN if [ -n "${single_binary_location_url}" ]; then \
78- echo "installing from single binary url: ${single_binary_location_url}" \
79- && rm -rf /tmp/clickhouse_binary \
80- && mkdir -p /tmp/clickhouse_binary \
81- && wget --progress=bar:force:noscroll "${single_binary_location_url}" -O /tmp/clickhouse_binary/clickhouse \
82- && chmod +x /tmp/clickhouse_binary/clickhouse \
83- && /tmp/clickhouse_binary/clickhouse install --user "clickhouse" --group "clickhouse" \
84- && rm -rf /tmp/* ; \
85- fi
86-
87- # The rest is the same in the official docker and in our build system
88- #docker-official-library:on
89-
90- # A fallback to installation from ClickHouse repository
91- # It works unless the clickhouse binary already exists
92- RUN clickhouse local -q 'SELECT 1' >/dev/null 2>&1 && exit 0 || : \
93- ; apt-get update \
94- && apt-get install --yes --no-install-recommends \
95- dirmngr \
96- gnupg2 \
97- && mkdir -p /etc/apt/sources.list.d \
98- && GNUPGHOME=$(mktemp -d) \
99- && GNUPGHOME="$GNUPGHOME" gpg --batch --no-default-keyring \
100- --keyring /usr/share/keyrings/clickhouse-keyring.gpg \
101- --keyserver hkp://keyserver.ubuntu.com:80 \
102- --recv-keys 3a9ea1193a97b548be1457d48919f6bd2b48d754 \
103- && rm -rf "$GNUPGHOME" \
104- && chmod +r /usr/share/keyrings/clickhouse-keyring.gpg \
105- && echo "${REPOSITORY}" > /etc/apt/sources.list.d/clickhouse.list \
106- && echo "installing from repository: ${REPOSITORY}" \
107- && apt-get update \
108- && for package in ${PACKAGES}; do \
109- packages="${packages} ${package}=${VERSION}" \
110- ; done \
111- && apt-get install --yes --no-install-recommends ${packages} || exit 1 \
112- && rm -rf \
113- /var/lib/apt/lists/* \
114- /var/cache/debconf \
115- /tmp/* \
116- && apt-get autoremove --purge -yq dirmngr gnupg2 \
117- && chmod ugo+Xrw -R /etc/clickhouse-server /etc/clickhouse-client
118- # The last chmod is here to make the next one is No-op in docker official library Dockerfile
50+ # NOTE (strtgbb): Removed install methods other than direct URL install to tidy the Dockerfile
11951
12052# post install
12153# we need to allow "others" access to clickhouse folder, because docker container
0 commit comments