Skip to content

Commit 1b23c47

Browse files
dinaratablinatjlee
authored andcommitted
[DBE-23224] Docker image for ClickHouse 25
1 parent c0a4527 commit 1b23c47

File tree

3 files changed

+95
-0
lines changed

3 files changed

+95
-0
lines changed

clickhouse/25/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM clickhouse/clickhouse-server:25.4
2+
3+
COPY ./data/os.tsv /opt/dictionaries/os.tsv
4+
COPY ./config/test_dictionary.xml /opt/dictionaries/test_dictionary.xml
5+
6+
ENV CLICKHOUSE_CONFIG=/etc/clickhouse-server/config.xml
7+
ENV CLICKHOUSE_CONFD=/etc/clickhouse-server/config.d/docker_related_config.xml
8+
ENV CLICKHOUSE_USER_CONFIG=/etc/clickhouse-server/users.xml
9+
10+
RUN sed -ri 's/<dictionaries_config>\*_dictionary\.xml<\/dictionaries_config>/<dictionaries_config>\/opt\/dictionaries\/test_dictionary.xml<\/dictionaries_config>/' ${CLICKHOUSE_CONFIG}
11+
RUN sed -ri 's/3<\/keep_alive_timeout>/<keep_alive_timeout>240<\/keep_alive_timeout>/' ${CLICKHOUSE_CONFD}
12+
13+
# readonly user
14+
RUN sed -ri 's/<ip>\:\:1<\/ip>/<ip>\:\:\/0<\/ip>/' ${CLICKHOUSE_USER_CONFIG}
15+
RUN sed -ri 's/<ip>127\.0\.0\.1<\/ip>/\ /' ${CLICKHOUSE_USER_CONFIG}
16+
RUN sed -ri 's/<!-- <readonly>/<readonly>/' ${CLICKHOUSE_USER_CONFIG}
17+
RUN sed -ri 's/<\/readonly> -->/<\/readonly>/' ${CLICKHOUSE_USER_CONFIG}
18+
RUN sed -ri 's/<!-- <access_management>/<access_management>/' ${CLICKHOUSE_USER_CONFIG}
19+
RUN sed -ri 's/<\/access_management> -->/<\/access_management>/' ${CLICKHOUSE_USER_CONFIG}
20+
21+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<dictionaries>
2+
<comment>Optional element with any content; completely ignored.</comment>
3+
4+
<!--You can set any number of different dictionaries. -->
5+
<dictionary>
6+
<!-- Dictionary name. The dictionary will be accessed for use by this name. -->
7+
<name>os</name>
8+
9+
<!-- Data source. -->
10+
<source>
11+
<!-- Source is a file in the local file system. -->
12+
<file>
13+
<!-- Path on the local file system. -->
14+
<path>/opt/dictionaries/os.tsv</path>
15+
<!-- Which format to use for reading the file. -->
16+
<format>TabSeparated</format>
17+
</file>
18+
</source>
19+
20+
<!-- Update interval for fully loaded dictionaries. 0 - never update. -->
21+
<lifetime>
22+
<min>300</min>
23+
<max>360</max>
24+
<!-- The update interval is selected uniformly randomly between min and max, in order to spread out the load when updating dictionaries on a large number of servers. -->
25+
</lifetime>
26+
27+
<!-- or <!- - The update interval for fully loaded dictionaries or invalidation time for cached dictionaries. 0 - never update. - ->
28+
<lifetime>300</lifetime>
29+
-->
30+
31+
<layout> <!-- Method for storing in memory. -->
32+
<flat />
33+
<!-- or <hashed />
34+
or
35+
<cache>
36+
<!- - Cache size in number of cells; rounded up to a degree of two. - ->
37+
<size_in_cells>1000000000</size_in_cells>
38+
</cache>
39+
or
40+
<ip_trie />
41+
-->
42+
</layout>
43+
44+
<!-- Structure. -->
45+
<structure>
46+
<!-- Description of the column that serves as the dictionary identifier (key). -->
47+
<id>
48+
<!-- Column name with ID. -->
49+
<name>Id</name>
50+
</id>
51+
52+
<attribute>
53+
<!-- Column name. -->
54+
<name>Name</name>
55+
<!-- Column type. (How the column is understood when loading. For MySQL, a table can have TEXT, VARCHAR, and BLOB, but these are all loaded as String) -->
56+
<type>String</type>
57+
<!-- Value to use for a non-existing element. In the example, an empty string. -->
58+
<null_value></null_value>
59+
</attribute>
60+
<!-- Any number of attributes can be specified. -->
61+
<attribute>
62+
<name>ParentID</name>
63+
<type>UInt64</type>
64+
<null_value>0</null_value>
65+
<!-- Whether it defines a hierarchy - mapping to the parent ID (by default, false). -->
66+
<hierarchical>true</hierarchical>
67+
<!-- The mapping id -> attribute can be considered injective, in order to optimize GROUP BY. (by default, false) -->
68+
<injective>true</injective>
69+
</attribute>
70+
</structure>
71+
</dictionary>
72+
</dictionaries>

clickhouse/25/data/os.tsv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1 Win 1
2+
2 OS/X 1

0 commit comments

Comments
 (0)