Merge pull request #3967 from yandex/add_env_for_disable_chown

Add env variable if user don't want to chown directories in docker image
This commit is contained in:
alexey-milovidov 2018-12-29 18:52:09 +03:00 committed by GitHub
commit 72b8181b6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,14 +27,16 @@ mkdir -p \
"$USER_PATH" \
"$FORMAT_SCHEMA_PATH"
# ensure proper directories permissions
chown -R $USER:$GROUP \
"$DATA_DIR" \
"$ERROR_LOG_DIR" \
"$LOG_DIR" \
"$TMP_DIR" \
"$USER_PATH" \
"$FORMAT_SCHEMA_PATH"
if [ "$CLICKHOUSE_DO_NOT_CHOWN" != "1" ]; then
# ensure proper directories permissions
chown -R $USER:$GROUP \
"$DATA_DIR" \
"$ERROR_LOG_DIR" \
"$LOG_DIR" \
"$TMP_DIR" \
"$USER_PATH" \
"$FORMAT_SCHEMA_PATH"
fi
if [ -n "$(ls /docker-entrypoint-initdb.d/)" ]; then
gosu clickhouse /usr/bin/clickhouse-server --config-file=$CLICKHOUSE_CONFIG &