diff --git a/docker-compose/base_os/README.md b/docker-compose/base_os/README.md index 1f0ebb09f..01e4a7dcd 100644 --- a/docker-compose/base_os/README.md +++ b/docker-compose/base_os/README.md @@ -2,6 +2,13 @@ These files install ClickHouse and test dependencies. -`clickhouse.Dockerfile` and `keeper.Dockerfile` are special, they are used with docker releases of ClickHouse, and thus only install test dependencies. +`clickhouse.Dockerfile` is special, it is used with docker releases of ClickHouse server and keeper, and thus only installs test dependencies. Adding support for a new distribution is simple, make a copy of the most closely related Dockerfile, name it accordingly, and adjust it as necessary. + +You can get the correct name with the following python snippet: + +```python +>>> "docker://redhat/ubi9:9.4".split("//")[-1].split(":")[0].split("/")[-1] + ".Dockerfile" +'ubi9.Dockerfile' +``` diff --git a/docker-compose/base_os/clickhouse.Dockerfile b/docker-compose/base_os/clickhouse.Dockerfile index ba0ab2079..ddb62f2c3 100644 --- a/docker-compose/base_os/clickhouse.Dockerfile +++ b/docker-compose/base_os/clickhouse.Dockerfile @@ -4,6 +4,9 @@ FROM $CLICKHOUSE_DOCKER_IMAGE_NAME ENV TZ=Europe/Berlin RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# Fix for 22.x keeper +RUN mkdir -p /var/lib/clickhouse/coordination + # install curl, base image could be alpine RUN if [ -f /etc/alpine-release ]; then \ apk update && \ diff --git a/docker-compose/base_os/keeper.Dockerfile b/docker-compose/base_os/keeper.Dockerfile deleted file mode 100644 index 2593d60b8..000000000 --- a/docker-compose/base_os/keeper.Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -ARG KEEPER_DOCKER_IMAGE -FROM $KEEPER_DOCKER_IMAGE - -ENV TZ=Europe/Berlin -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -# Fix for 22.x -RUN mkdir -p /var/lib/clickhouse/coordination \ No newline at end of file diff --git a/docker-compose/keeper-service.yml b/docker-compose/keeper-service.yml index 7fb8f2192..b5d20a195 100644 --- a/docker-compose/keeper-service.yml +++ b/docker-compose/keeper-service.yml @@ -6,7 +6,7 @@ services: pull_policy: never build: context: .. - dockerfile: docker-compose/base_os/${CLICKHOUSE_TESTS_KEEPER_BASE_OS_NAME:-keeper}.Dockerfile + dockerfile: docker-compose/base_os/${CLICKHOUSE_TESTS_KEEPER_BASE_OS_NAME:-clickhouse}.Dockerfile args: KEEPER_DOCKER_IMAGE: $CLICKHOUSE_TESTS_KEEPER_DOCKER_IMAGE CLICKHOUSE_PACKAGE: $CLICKHOUSE_TESTS_KEEPER_BIN_PATH diff --git a/helpers/cluster.py b/helpers/cluster.py index 203a9c806..2179a0674 100755 --- a/helpers/cluster.py +++ b/helpers/cluster.py @@ -1904,7 +1904,7 @@ def up(self, timeout=30 * 60): ) self.environ["CLICKHOUSE_TESTS_KEEPER_BASE_OS"] = self.keeper_base_os self.environ["CLICKHOUSE_TESTS_KEEPER_BASE_OS_NAME"] = ( - "keeper" + "clickhouse" if not self.keeper_base_os else self.keeper_base_os.split(":")[0].split("/")[-1] )