docker --version
{
"registry-mirrors": [
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn"
],
"insecure-registries": [],
"debug": false,
"experimental": false,
"features": {
"buildkit": true
}
}
docker pull yandex/clickhouse-server
docker pull yandex/clickhouse-client
docker run --rm -d --name=temp-clickhouse-server yandex/clickhouse-server
docker cp temp-clickhouse-server:/etc/clickhouse-server/config.xml D:/clickhouse/conf/config.xml
docker cp temp-clickhouse-server:/etc/clickhouse-server/users.xml D:/clickhouse/conf/users.xml
docker exec -it temp-clickhouse-server /bin/bash
PASSWORD=$(base64 < /dev/urandom | head -c8); echo "zhai"; echo -n "zhai" | sha256sum | tr -d '-'
<users>
<zhai>
<password_sha256_hex>3b75903cd12c5e8ad59f73feb4baa526ed3fe234f2d77d421d7b9d73fefb3f61</password_sha256_hex>
<networks incl="networks" replace="replace">
<ip>::/0</ip>
</networks>
<profile>zhai</profile>
<quota>zhai</quota>
</zhai>
</users>
<listen_host>0.0.0.0</listen_host>
docker stop temp-clickhouse-server
docker run -d --name=single-clickhouse-server -p 8123:8123 -p 9000:9000 -p 9009:9009 --ulimit nofile=262144:262144 --volume D:/clickhouse/data:/var/lib/clickhouse:rw --volume D:/clickhouse/conf:/etc/clickhouse-server:rw --volume D:/clickhouse/log:/var/log/clickhouse-server:rw yandex/clickhouse-server