Change Docker org name

This commit is contained in:
Alexey Milovidov 2021-09-20 01:52:21 +03:00
parent f0925b3cf6
commit ab44e0addb
4 changed files with 16 additions and 16 deletions

View File

@ -2,14 +2,14 @@ version: "2"
services: services:
builder: builder:
image: yandex/clickhouse-builder image: clickhouse/clickhouse-builder
build: docker/builder build: docker/builder
client: client:
image: yandex/clickhouse-client image: clickhouse/clickhouse-client
build: docker/client build: docker/client
command: ['--host', 'server'] command: ['--host', 'server']
server: server:
image: yandex/clickhouse-server image: clickhouse/clickhouse-server
build: docker/server build: docker/server
ports: ports:
- 8123:8123 - 8123:8123

View File

@ -12,14 +12,14 @@ For more information and documentation see https://clickhouse.yandex/.
### start server instance ### start server instance
```bash ```bash
$ docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server $ docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server
``` ```
By default ClickHouse will be accessible only via docker network. See the [networking section below](#networking). By default ClickHouse will be accessible only via docker network. See the [networking section below](#networking).
### connect to it from a native client ### connect to it from a native client
```bash ```bash
$ docker run -it --rm --link some-clickhouse-server:clickhouse-server yandex/clickhouse-client --host clickhouse-server $ docker run -it --rm --link some-clickhouse-server:clickhouse-server clickhouse/clickhouse-client --host clickhouse-server
``` ```
More information about [ClickHouse client](https://clickhouse.yandex/docs/en/interfaces/cli/). More information about [ClickHouse client](https://clickhouse.yandex/docs/en/interfaces/cli/).
@ -43,7 +43,7 @@ $ docker rm some-clickhouse-server
You can expose you ClickHouse running in docker by [mapping particular port](https://docs.docker.com/config/containers/container-networking/) from inside container to a host ports: You can expose you ClickHouse running in docker by [mapping particular port](https://docs.docker.com/config/containers/container-networking/) from inside container to a host ports:
```bash ```bash
$ docker run -d -p 18123:8123 -p19000:9000 --name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server $ docker run -d -p 18123:8123 -p19000:9000 --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server
$ echo 'SELECT version()' | curl 'http://localhost:18123/' --data-binary @- $ echo 'SELECT version()' | curl 'http://localhost:18123/' --data-binary @-
20.12.3.3 20.12.3.3
``` ```
@ -51,7 +51,7 @@ $ echo 'SELECT version()' | curl 'http://localhost:18123/' --data-binary @-
or by allowing container to use [host ports directly](https://docs.docker.com/network/host/) using `--network=host` (also allows archiving better network performance): or by allowing container to use [host ports directly](https://docs.docker.com/network/host/) using `--network=host` (also allows archiving better network performance):
```bash ```bash
$ docker run -d --network=host --name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server $ docker run -d --network=host --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server
$ echo 'SELECT version()' | curl 'http://localhost:8123/' --data-binary @- $ echo 'SELECT version()' | curl 'http://localhost:8123/' --data-binary @-
20.12.3.3 20.12.3.3
``` ```
@ -67,7 +67,7 @@ Typically you may want to mount the following folders inside your container to a
$ docker run -d \ $ docker run -d \
-v $(realpath ./ch_data):/var/lib/clickhouse/ \ -v $(realpath ./ch_data):/var/lib/clickhouse/ \
-v $(realpath ./ch_logs):/var/log/clickhouse-server/ \ -v $(realpath ./ch_logs):/var/log/clickhouse-server/ \
--name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server
``` ```
You may also want to mount: You may also want to mount:
@ -85,7 +85,7 @@ It is optional and can be enabled using the following [docker command line agrum
```bash ```bash
$ docker run -d \ $ docker run -d \
--cap-add=SYS_NICE --cap-add=NET_ADMIN --cap-add=IPC_LOCK \ --cap-add=SYS_NICE --cap-add=NET_ADMIN --cap-add=IPC_LOCK \
--name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server
``` ```
## Configuration ## Configuration
@ -96,19 +96,19 @@ ClickHouse configuration represented with a file "config.xml" ([documentation](h
### Start server instance with custom configuration ### Start server instance with custom configuration
```bash ```bash
$ docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 -v /path/to/your/config.xml:/etc/clickhouse-server/config.xml yandex/clickhouse-server $ docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 -v /path/to/your/config.xml:/etc/clickhouse-server/config.xml clickhouse/clickhouse-server
``` ```
### Start server as custom user ### Start server as custom user
``` ```
# $(pwd)/data/clickhouse should exist and be owned by current user # $(pwd)/data/clickhouse should exist and be owned by current user
$ 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" yandex/clickhouse-server $ 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/clickhouse-server
``` ```
When you use the image with mounting local directories inside you probably would like to not mess your directory tree with files owner and permissions. Then you could use `--user` argument. In this case, you should mount every necessary directory (`/var/lib/clickhouse` and `/var/log/clickhouse-server`) inside the container. Otherwise, image will complain and not start. When you use the image with mounting local directories inside you probably would like to not mess your directory tree with files owner and permissions. Then you could use `--user` argument. In this case, you should mount every necessary directory (`/var/lib/clickhouse` and `/var/log/clickhouse-server`) inside the container. Otherwise, image will complain and not start.
### Start server from root (useful in case of userns enabled) ### Start server from root (useful in case of userns enabled)
``` ```
$ docker run --rm -e CLICKHOUSE_UID=0 -e CLICKHOUSE_GID=0 --name clickhouse-server-userns -v "$(pwd)/logs/clickhouse:/var/log/clickhouse-server" -v "$(pwd)/data/clickhouse:/var/lib/clickhouse" yandex/clickhouse-server $ docker run --rm -e CLICKHOUSE_UID=0 -e CLICKHOUSE_GID=0 --name clickhouse-server-userns -v "$(pwd)/logs/clickhouse:/var/log/clickhouse-server" -v "$(pwd)/data/clickhouse:/var/lib/clickhouse" clickhouse/clickhouse-server
``` ```
### How to create default database and user on starting ### How to create default database and user on starting
@ -116,7 +116,7 @@ $ docker run --rm -e CLICKHOUSE_UID=0 -e CLICKHOUSE_GID=0 --name clickhouse-serv
Sometimes you may want to create user (user named `default` is used by default) and database on image starting. You can do it using environment variables `CLICKHOUSE_DB`, `CLICKHOUSE_USER`, `CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT` and `CLICKHOUSE_PASSWORD`: Sometimes you may want to create user (user named `default` is used by default) and database on image starting. You can do it using environment variables `CLICKHOUSE_DB`, `CLICKHOUSE_USER`, `CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT` and `CLICKHOUSE_PASSWORD`:
``` ```
$ 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 yandex/clickhouse-server $ 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/clickhouse-server
``` ```
## How to extend this image ## How to extend this image

View File

@ -16,4 +16,4 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
for i in {3950..4100}; do ${CLICKHOUSE_CURL} --user default:12345 "${CLICKHOUSE_URL}&query=SELECT+1"$(perl -e "print '+'x$i") | grep -v -F 'password' ||:; done for i in {3950..4100}; do ${CLICKHOUSE_CURL} --user default:12345 "${CLICKHOUSE_URL}&query=SELECT+1"$(perl -e "print '+'x$i") | grep -v -F 'password' ||:; done
# You can check that the bug exists in old version by running the old server in Docker: # You can check that the bug exists in old version by running the old server in Docker:
# docker run --network host -it --rm yandex/clickhouse-server:1.1.54385 # docker run --network host -it --rm clickhouse/clickhouse-server:1.1.54385

View File

@ -26,11 +26,11 @@ then
# https://stackoverflow.com/a/39454426/1555175 # https://stackoverflow.com/a/39454426/1555175
wget -nv https://registry.hub.docker.com/v1/repositories/clickhouse/clickhouse-server/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' wget -nv https://registry.hub.docker.com/v1/repositories/clickhouse/clickhouse-server/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'
else else
docker pull yandex/clickhouse-server:${param} docker pull clickhouse/clickhouse-server:${param}
tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX) # older version require /nonexistent folder to exist to run clickhouse client :D tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX) # older version require /nonexistent folder to exist to run clickhouse client :D
chmod 777 ${tmp_dir} chmod 777 ${tmp_dir}
set -e set -e
containerid=`docker run -v${tmp_dir}:/nonexistent -d yandex/clickhouse-server:${param}` containerid=`docker run -v${tmp_dir}:/nonexistent -d clickhouse/clickhouse-server:${param}`
set +e set +e
while : while :
do do