We build clickhouse cluster in k8s by clickhouse-operator.
clickhouse-server.log is mounted by emptydir on the path `/var/log/clickhouse-server`.
It causes the file system error called `Necessary directory '/var/log/clickhouse-server' isn't owned by user with id '101' ` when CLICKHOUSE_DO_NOT_CHOWN is set to true(1).
Because emptydir file and dir is owned by root when it started, it has to do the chown cmd.
But it will take a long time to run chown cmd when the cluster has much data (in table data dir), the cluster cannot even restart because of `initialDelaySeconds`
So chown operation is necessary to check if the file owner and group is owned by user 101.
Introduce 2 arguments for clickhouse-server image Dockerfile:
deb_location & single_binary_location
That enables to build docker images from CI build easily, also for non-standard
builds (with sanitizers / for arm64 etc).
`http_port` can be removed from the configuration when serving HTTP is
not desired. When it is not present, `extract-from-config` will fail,
which will prevent the server from starting.
Only fetch it when it is required for database initialization.
Explicitly set uid / gid of clickhouse user & group to the fixed values 101.
It is especially important for rootless containers: in that case entrypoint can't do chown
and owners of mounted volumes should be configured externally.
We do that in advance at the begining of Dockerfile before any packages will be installed
to prevent picking those uid / gid by some unrelated software.
The same uid / gid (101) is used both for alpine and ubuntu.
Number 101 is used by default in openshift, and was used by all clickhouse-server docker images
before 20.10. In 20.11 it was changed (by accident) to 999.