Skip to content

Commit 0f8641c

Browse files
Run update.sh
1 parent 007e320 commit 0f8641c

File tree

2 files changed

+222
-5
lines changed

2 files changed

+222
-5
lines changed

clickhouse/README.md

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
<!--
2+
3+
********************************************************************************
4+
5+
WARNING:
6+
7+
DO NOT EDIT "clickhouse/README.md"
8+
9+
IT IS AUTO-GENERATED
10+
11+
(from the other files in "clickhouse/" combined with a set of templates)
12+
13+
********************************************************************************
14+
15+
-->
16+
17+
# Quick reference
18+
19+
- **Maintained by**:
20+
[ClickHouse Inc.](https://github.com/ClickHouse/ClickHouse)
21+
22+
- **Where to get help**:
23+
[the Docker Community Slack](https://dockr.ly/comm-slack), [Server Fault](https://serverfault.com/help/on-topic), [Unix & Linux](https://unix.stackexchange.com/help/on-topic), or [Stack Overflow](https://stackoverflow.com/help/on-topic)
24+
25+
# Supported tags and respective `Dockerfile` links
26+
27+
- [`latest`, `jammy`, `24`, `24-jammy`, `24.10`, `24.10-jammy`, `24.10.1`, `24.10.1-jammy`, `24.10.1.2812`, `24.10.1.2812-jammy`](https://github.com/ClickHouse/docker-library/blob/8f3278549dd6ac2832287c18c6a35a5f90eb3394/server/24.10.1.2812/Dockerfile.ubuntu)
28+
29+
# Quick reference (cont.)
30+
31+
- **Where to file issues**:
32+
[https://github.com/ClickHouse/ClickHouse/issues](https://github.com/ClickHouse/ClickHouse/issues?q=)
33+
34+
- **Supported architectures**: ([more info](https://github.com/docker-library/official-images#architectures-other-than-amd64))
35+
[`amd64`](https://hub.docker.com/r/amd64/clickhouse/), [`arm64v8`](https://hub.docker.com/r/arm64v8/clickhouse/)
36+
37+
- **Published image artifact details**:
38+
[repo-info repo's `repos/clickhouse/` directory](https://github.com/docker-library/repo-info/blob/master/repos/clickhouse) ([history](https://github.com/docker-library/repo-info/commits/master/repos/clickhouse))
39+
(image metadata, transfer size, etc)
40+
41+
- **Image updates**:
42+
[official-images repo's `library/clickhouse` label](https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fclickhouse)
43+
[official-images repo's `library/clickhouse` file](https://github.com/docker-library/official-images/blob/master/library/clickhouse) ([history](https://github.com/docker-library/official-images/commits/master/library/clickhouse))
44+
45+
- **Source of this description**:
46+
[docs repo's `clickhouse/` directory](https://github.com/docker-library/docs/tree/master/clickhouse) ([history](https://github.com/docker-library/docs/commits/master/clickhouse))
47+
48+
# ClickHouse Server Docker Image
49+
50+
## What is ClickHouse?
51+
52+
![logo](https://raw.githubusercontent.com/docker-library/docs/007e3209490145a9855f4825218a9a08753d425b/clickhouse/logo.svg?sanitize=true)
53+
54+
ClickHouse is an open-source column-oriented DBMS (columnar database management system) for online analytical processing (OLAP) that allows users to generate analytical reports using SQL queries in real-time.
55+
56+
ClickHouse works 100-1000x faster than traditional database management systems, and processes hundreds of millions to over a billion rows and tens of gigabytes of data per server per second. With a widespread user base around the globe, the technology has received praise for its reliability, ease of use, and fault tolerance.
57+
58+
For more information and documentation see https://clickhouse.com/.
59+
60+
### Compatibility
61+
62+
- The amd64 image requires support for [SSE3 instructions](https://en.wikipedia.org/wiki/SSE3). Virtually all x86 CPUs after 2005 support SSE3.
63+
- The arm64 image requires support for the [ARMv8.2-A architecture](https://en.wikipedia.org/wiki/AArch64#ARMv8.2-A) and additionally the Load-Acquire RCpc register. The register is optional in version ARMv8.2-A and mandatory in [ARMv8.3-A](https://en.wikipedia.org/wiki/AArch64#ARMv8.3-A). Supported in Graviton >=2, Azure and GCP instances. Examples for unsupported devices are Raspberry Pi 4 (ARMv8.0-A) and Jetson AGX Xavier/Orin (ARMv8.2-A).
64+
- Since the Clickhouse 24.11 Ubuntu images started using `ubuntu:22.04` as its base image. It requires docker version >= `20.10.10` containing [patch](https://github.com/moby/moby/commit/977283509f75303bc6612665a04abf76ff1d2468). As a workaround you could use `docker run --security-opt seccomp=unconfined` instead, however that has security implications.
65+
66+
## How to use this image
67+
68+
### start server instance
69+
70+
```bash
71+
docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse
72+
```
73+
74+
By default, ClickHouse will be accessible only via the Docker network. See the **networking** section below.
75+
76+
By default, starting above server instance will be run as the `default` user without password.
77+
78+
### connect to it from a native client
79+
80+
```bash
81+
docker run -it --rm --link some-clickhouse-server:clickhouse-server --entrypoint clickhouse-client clickhouse --host clickhouse-server
82+
# OR
83+
docker exec -it some-clickhouse-server clickhouse-client
84+
```
85+
86+
More information about the [ClickHouse client](https://clickhouse.com/docs/en/interfaces/cli/).
87+
88+
### connect to it using curl
89+
90+
```bash
91+
echo "SELECT 'Hello, ClickHouse!'" | docker run -i --rm --link some-clickhouse-server:clickhouse-server buildpack-deps:curl curl 'http://clickhouse-server:8123/?query=' -s --data-binary @-
92+
```
93+
94+
More information about the [ClickHouse HTTP Interface](https://clickhouse.com/docs/en/interfaces/http/).
95+
96+
### stopping / removing the container
97+
98+
```bash
99+
docker stop some-clickhouse-server
100+
docker rm some-clickhouse-server
101+
```
102+
103+
### networking
104+
105+
You can expose your ClickHouse running in docker by [mapping a particular port](https://docs.docker.com/config/containers/container-networking/) from inside the container using host ports:
106+
107+
```bash
108+
docker run -d -p 18123:8123 -p19000:9000 --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse
109+
echo 'SELECT version()' | curl 'http://localhost:18123/' --data-binary @-
110+
```
111+
112+
`22.6.3.35`
113+
114+
Or by allowing the container to use [host ports directly](https://docs.docker.com/network/host/) using `--network=host` (also allows achieving better network performance):
115+
116+
```bash
117+
docker run -d --network=host --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse
118+
echo 'SELECT version()' | curl 'http://localhost:8123/' --data-binary @-
119+
```
120+
121+
`22.6.3.35`
122+
123+
### Volumes
124+
125+
Typically you may want to mount the following folders inside your container to achieve persistency:
126+
127+
- `/var/lib/clickhouse/` - main folder where ClickHouse stores the data
128+
- `/var/log/clickhouse-server/` - logs
129+
130+
```bash
131+
docker run -d \
132+
-v "$PWD/ch_data:/var/lib/clickhouse/" \
133+
-v "$PWD/ch_logs:/var/log/clickhouse-server/" \
134+
--name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse
135+
```
136+
137+
You may also want to mount:
138+
139+
- `/etc/clickhouse-server/config.d/*.xml` - files with server configuration adjustments
140+
- `/etc/clickhouse-server/users.d/*.xml` - files with user settings adjustments
141+
- `/docker-entrypoint-initdb.d/` - folder with database initialization scripts (see below).
142+
143+
### Linux capabilities
144+
145+
ClickHouse has some advanced functionality, which requires enabling several [Linux capabilities](https://man7.org/linux/man-pages/man7/capabilities.7.html).
146+
147+
They are optional and can be enabled using the following [docker command-line arguments](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities):
148+
149+
```bash
150+
docker run -d \
151+
--cap-add=SYS_NICE --cap-add=NET_ADMIN --cap-add=IPC_LOCK \
152+
--name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse
153+
```
154+
155+
Read more in [knowledge base](https://clickhouse.com/docs/knowledgebase/configure_cap_ipc_lock_and_cap_sys_nice_in_docker).
156+
157+
## Configuration
158+
159+
The container exposes port 8123 for the [HTTP interface](https://clickhouse.com/docs/en/interfaces/http_interface/) and port 9000 for the [native client](https://clickhouse.com/docs/en/interfaces/tcp/).
160+
161+
ClickHouse configuration is represented with a file "config.xml" ([documentation](https://clickhouse.com/docs/en/operations/configuration_files/))
162+
163+
### Start server instance with custom configuration
164+
165+
```bash
166+
docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 -v /path/to/your/config.xml:/etc/clickhouse-server/config.xml clickhouse
167+
```
168+
169+
### Start server as custom user
170+
171+
```bash
172+
# $PWD/data/clickhouse should exist and be owned by current user
173+
docker run --rm --user "${UID}:${GID}" --name some-clickhouse-server --ulimit nofile=262144:262144 -v "$PWD/logs/clickhouse:/var/log/clickhouse-server" -v "$PWD/data/clickhouse:/var/lib/clickhouse" clickhouse
174+
```
175+
176+
When you use the image with local directories mounted, you probably want to specify the user to maintain the proper file ownership. Use the `--user` argument and mount `/var/lib/clickhouse` and `/var/log/clickhouse-server` inside the container. Otherwise, the image will complain and not start.
177+
178+
### Start server from root (useful in case of enabled user namespace)
179+
180+
```bash
181+
docker run --rm -e CLICKHOUSE_RUN_AS_ROOT=1 --name clickhouse-server-userns -v "$PWD/logs/clickhouse:/var/log/clickhouse-server" -v "$PWD/data/clickhouse:/var/lib/clickhouse" clickhouse
182+
```
183+
184+
### How to create default database and user on starting
185+
186+
Sometimes you may want to create a user (user named `default` is used by default) and database on a container start. You can do it using environment variables `CLICKHOUSE_DB`, `CLICKHOUSE_USER`, `CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT` and `CLICKHOUSE_PASSWORD`:
187+
188+
```bash
189+
docker run --rm -e CLICKHOUSE_DB=my_database -e CLICKHOUSE_USER=username -e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 -e CLICKHOUSE_PASSWORD=password -p 9000:9000/tcp clickhouse
190+
```
191+
192+
## How to extend this image
193+
194+
To perform additional initialization in an image derived from this one, add one or more `*.sql`, `*.sql.gz`, or `*.sh` scripts under `/docker-entrypoint-initdb.d`. After the entrypoint calls `initdb`, it will run any `*.sql` files, run any executable `*.sh` scripts, and source any non-executable `*.sh` scripts found in that directory to do further initialization before starting the service.
195+
Also, you can provide environment variables `CLICKHOUSE_USER` & `CLICKHOUSE_PASSWORD` that will be used for clickhouse-client during initialization.
196+
197+
For example, to add an additional user and database, add the following to `/docker-entrypoint-initdb.d/init-db.sh`:
198+
199+
```bash
200+
#!/bin/bash
201+
set -e
202+
203+
clickhouse client -n <<-EOSQL
204+
CREATE DATABASE docker;
205+
CREATE TABLE docker.docker (x Int32) ENGINE = Log;
206+
EOSQL
207+
```
208+
209+
# License
210+
211+
View [license information](https://github.com/ClickHouse/ClickHouse/blob/master/LICENSE) for the software contained in this image.
212+
213+
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
214+
215+
Some additional license information which was able to be auto-detected might be found in [the `repo-info` repository's `clickhouse/` directory](https://github.com/docker-library/repo-info/tree/master/repos/clickhouse).
216+
217+
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

docker/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ WARNING:
2828

2929
## Simple Tags
3030

31-
- [`27.3.1-cli`, `27.3-cli`, `27-cli`, `cli`, `27.3.1-cli-alpine3.20`](https://github.com/docker-library/docker/blob/bef014490d74e648d3b6a0ff61919022c150a12b/27/cli/Dockerfile)
31+
- [`27.3.1-cli`, `27.3-cli`, `27-cli`, `cli`, `27.3.1-cli-alpine3.20`](https://github.com/docker-library/docker/blob/9095b12e6b5eb72689fb2c15f76403ce35ce04f7/27/cli/Dockerfile)
3232

3333
- [`27.3.1-dind`, `27.3-dind`, `27-dind`, `dind`, `27.3.1-dind-alpine3.20`, `27.3.1`, `27.3`, `27`, `latest`, `27.3.1-alpine3.20`](https://github.com/docker-library/docker/blob/97331ed1dd7c07dd5aa852e01aa5deff5d2aed09/27/dind/Dockerfile)
3434

3535
- [`27.3.1-dind-rootless`, `27.3-dind-rootless`, `27-dind-rootless`, `dind-rootless`](https://github.com/docker-library/docker/blob/97331ed1dd7c07dd5aa852e01aa5deff5d2aed09/27/dind-rootless/Dockerfile)
3636

37-
- [`27.3.1-windowsservercore-ltsc2022`, `27.3-windowsservercore-ltsc2022`, `27-windowsservercore-ltsc2022`, `windowsservercore-ltsc2022`](https://github.com/docker-library/docker/blob/bef014490d74e648d3b6a0ff61919022c150a12b/27/windows/windowsservercore-ltsc2022/Dockerfile)
37+
- [`27.3.1-windowsservercore-ltsc2022`, `27.3-windowsservercore-ltsc2022`, `27-windowsservercore-ltsc2022`, `windowsservercore-ltsc2022`](https://github.com/docker-library/docker/blob/9095b12e6b5eb72689fb2c15f76403ce35ce04f7/27/windows/windowsservercore-ltsc2022/Dockerfile)
3838

39-
- [`27.3.1-windowsservercore-1809`, `27.3-windowsservercore-1809`, `27-windowsservercore-1809`, `windowsservercore-1809`](https://github.com/docker-library/docker/blob/bef014490d74e648d3b6a0ff61919022c150a12b/27/windows/windowsservercore-1809/Dockerfile)
39+
- [`27.3.1-windowsservercore-1809`, `27.3-windowsservercore-1809`, `27-windowsservercore-1809`, `windowsservercore-1809`](https://github.com/docker-library/docker/blob/9095b12e6b5eb72689fb2c15f76403ce35ce04f7/27/windows/windowsservercore-1809/Dockerfile)
4040

4141
## Shared Tags
4242

4343
- `27.3.1-windowsservercore`, `27.3-windowsservercore`, `27-windowsservercore`, `windowsservercore`:
4444

45-
- [`27.3.1-windowsservercore-ltsc2022`](https://github.com/docker-library/docker/blob/bef014490d74e648d3b6a0ff61919022c150a12b/27/windows/windowsservercore-ltsc2022/Dockerfile)
46-
- [`27.3.1-windowsservercore-1809`](https://github.com/docker-library/docker/blob/bef014490d74e648d3b6a0ff61919022c150a12b/27/windows/windowsservercore-1809/Dockerfile)
45+
- [`27.3.1-windowsservercore-ltsc2022`](https://github.com/docker-library/docker/blob/9095b12e6b5eb72689fb2c15f76403ce35ce04f7/27/windows/windowsservercore-ltsc2022/Dockerfile)
46+
- [`27.3.1-windowsservercore-1809`](https://github.com/docker-library/docker/blob/9095b12e6b5eb72689fb2c15f76403ce35ce04f7/27/windows/windowsservercore-1809/Dockerfile)
4747

4848
# Quick reference (cont.)
4949

0 commit comments

Comments
 (0)