Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bitnami/clickhouse/25/debian-12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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." \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:-}"}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 <<EOF >"${admin_user_override}"
Expand Down
21 changes: 11 additions & 10 deletions bitnami/clickhouse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading