diff --git a/bitnami/clickhouse/25/debian-12/Dockerfile b/bitnami/clickhouse/25/debian-12/Dockerfile index 6df3e0677cdcc..b4455666916d2 100644 --- a/bitnami/clickhouse/25/debian-12/Dockerfile +++ b/bitnami/clickhouse/25/debian-12/Dockerfile @@ -8,10 +8,10 @@ ARG TARGETARCH LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \ org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \ - org.opencontainers.image.created="2025-04-05T18:33:13Z" \ + org.opencontainers.image.created="2025-04-07T10:22:04Z" \ org.opencontainers.image.description="Application packaged by Broadcom, Inc." \ org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/clickhouse/README.md" \ - org.opencontainers.image.ref.name="25.3.2-debian-12-r1" \ + org.opencontainers.image.ref.name="25.3.2-debian-12-r2" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/clickhouse" \ org.opencontainers.image.title="clickhouse" \ org.opencontainers.image.vendor="Broadcom, Inc." \ diff --git a/bitnami/clickhouse/25/debian-12/rootfs/opt/bitnami/scripts/clickhouse-env.sh b/bitnami/clickhouse/25/debian-12/rootfs/opt/bitnami/scripts/clickhouse-env.sh index 4a82bf3c31c9e..c04500f9d3846 100644 --- a/bitnami/clickhouse/25/debian-12/rootfs/opt/bitnami/scripts/clickhouse-env.sh +++ b/bitnami/clickhouse/25/debian-12/rootfs/opt/bitnami/scripts/clickhouse-env.sh @@ -25,6 +25,7 @@ export BITNAMI_DEBUG="${BITNAMI_DEBUG:-false}" # variable will be overridden with the value specified in that file clickhouse_env_vars=( ALLOW_EMPTY_PASSWORD + CLICKHOUSE_SKIP_USER_SETUP CLICKHOUSE_ADMIN_USER CLICKHOUSE_ADMIN_PASSWORD CLICKHOUSE_HTTP_PORT @@ -65,6 +66,7 @@ export CLICKHOUSE_INITSCRIPTS_DIR="/docker-entrypoint-initdb.d" # ClickHouse configuration parameters export ALLOW_EMPTY_PASSWORD="${ALLOW_EMPTY_PASSWORD:-no}" +export CLICKHOUSE_SKIP_USER_SETUP="${CLICKHOUSE_SKIP_USER_SETUP:-no}" CLICKHOUSE_ADMIN_USER="${CLICKHOUSE_ADMIN_USER:-"${CLICKHOUSE_USER:-}"}" export CLICKHOUSE_ADMIN_USER="${CLICKHOUSE_ADMIN_USER:-default}" CLICKHOUSE_ADMIN_PASSWORD="${CLICKHOUSE_ADMIN_PASSWORD:-"${CLICKHOUSE_PASSWORD:-}"}" diff --git a/bitnami/clickhouse/25/debian-12/rootfs/opt/bitnami/scripts/libclickhouse.sh b/bitnami/clickhouse/25/debian-12/rootfs/opt/bitnami/scripts/libclickhouse.sh index ee937d1994e4c..f77b425737fcc 100644 --- a/bitnami/clickhouse/25/debian-12/rootfs/opt/bitnami/scripts/libclickhouse.sh +++ b/bitnami/clickhouse/25/debian-12/rootfs/opt/bitnami/scripts/libclickhouse.sh @@ -54,10 +54,12 @@ clickhouse_validate() { ! is_empty_value "$CLICKHOUSE_INTERSERVER_HTTP_PORT" && check_valid_port "CLICKHOUSE_INTERSERVER_HTTP_PORT" # Validate credentials - if is_boolean_yes "${ALLOW_EMPTY_PASSWORD:-}"; then - warn "You set the environment variable ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD:-}. For safety reasons, do not use this flag in a production environment." - elif is_empty_value "$CLICKHOUSE_ADMIN_PASSWORD"; then - print_validation_error "The CLICKHOUSE_ADMIN_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow a blank password. This is only recommended for development environments." + if ! is_boolean_yes "$CLICKHOUSE_SKIP_USER_SETUP"; then + if is_boolean_yes "${ALLOW_EMPTY_PASSWORD:-}"; then + warn "You set the environment variable ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD:-}. For safety reasons, do not use this flag in a production environment." + elif is_empty_value "$CLICKHOUSE_ADMIN_PASSWORD"; then + print_validation_error "The CLICKHOUSE_ADMIN_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow a blank password. This is only recommended for development environments." + fi fi return "$error_code" @@ -191,7 +193,9 @@ clickhouse_initialize() { rm -f "$CLICKHOUSE_PID_FILE" clickhouse_copy_mounted_configuration - if [[ "$CLICKHOUSE_ADMIN_USER" != "default" ]]; then + if is_boolean_yes "$CLICKHOUSE_SKIP_USER_SETUP"; then + info "Skipping user setup" + elif [[ "$CLICKHOUSE_ADMIN_USER" != "default" ]]; then # If we need to set an admin user different from default, we create a configuration override local -r admin_user_override="${CLICKHOUSE_CONF_DIR}/users.d/__bitnami_default_user.xml" cat <"${admin_user_override}" diff --git a/bitnami/clickhouse/README.md b/bitnami/clickhouse/README.md index 118c00c244382..213f16c38c30a 100644 --- a/bitnami/clickhouse/README.md +++ b/bitnami/clickhouse/README.md @@ -201,16 +201,17 @@ In order to have your custom files inside the docker image you can mount them as #### Customizable environment variables -| Name | Description | Default Value | -|------------------------------------|-------------------------------|---------------| -| `ALLOW_EMPTY_PASSWORD` | Allow an empty password. | `no` | -| `CLICKHOUSE_ADMIN_USER` | ClickHouse admin username. | `default` | -| `CLICKHOUSE_ADMIN_PASSWORD` | ClickHouse admin password. | `nil` | -| `CLICKHOUSE_HTTP_PORT` | ClickHouse HTTP port. | `8123` | -| `CLICKHOUSE_TCP_PORT` | ClickHouse TCP port. | `9000` | -| `CLICKHOUSE_MYSQL_PORT` | ClickHouse MySQL port. | `9004` | -| `CLICKHOUSE_POSTGRESQL_PORT` | ClickHouse PostgreSQL port. | `9005` | -| `CLICKHOUSE_INTERSERVER_HTTP_PORT` | ClickHouse Inter-server port. | `9009` | +| Name | Description | Default Value | +|------------------------------------|-----------------------------------|---------------| +| `ALLOW_EMPTY_PASSWORD` | Allow an empty password. | `no` | +| `CLICKHOUSE_SKIP_USER_SETUP` | Skip ClickHouse admin user setup. | `no` | +| `CLICKHOUSE_ADMIN_USER` | ClickHouse admin username. | `default` | +| `CLICKHOUSE_ADMIN_PASSWORD` | ClickHouse admin password. | `nil` | +| `CLICKHOUSE_HTTP_PORT` | ClickHouse HTTP port. | `8123` | +| `CLICKHOUSE_TCP_PORT` | ClickHouse TCP port. | `9000` | +| `CLICKHOUSE_MYSQL_PORT` | ClickHouse MySQL port. | `9004` | +| `CLICKHOUSE_POSTGRESQL_PORT` | ClickHouse PostgreSQL port. | `9005` | +| `CLICKHOUSE_INTERSERVER_HTTP_PORT` | ClickHouse Inter-server port. | `9009` | #### Read-only environment variables