FROM alpine ENV LANG=en_US.UTF-8 \ LANGUAGE=en_US:en \ LC_ALL=en_US.UTF-8 \ TZ=UTC \ CLICKHOUSE_CONFIG=/etc/clickhouse-server/config.xml COPY alpine-root/ / # user/group precreated explicitly with fixed uid/gid on purpose. # 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 RUN addgroup -S -g 101 clickhouse \ && adduser -S -h /var/lib/clickhouse -s /bin/bash -G clickhouse -g "ClickHouse server" -u 101 clickhouse \ && chown clickhouse:clickhouse /var/lib/clickhouse \ && chmod 700 /var/lib/clickhouse \ && chown root:clickhouse /var/log/clickhouse-server \ && chmod 775 /var/log/clickhouse-server \ && chmod +x /entrypoint.sh \ && apk add --no-cache su-exec bash EXPOSE 9000 8123 9009 VOLUME /var/lib/clickhouse \ /var/log/clickhouse-server ENTRYPOINT ["/entrypoint.sh"]