Search code examples
macosdockerclickhouse

Can't connect from outside of container to Clickhouse by HTTP on Mac OS


I'm trying to use ClickHouse with docker on Mac OS. I use next command:

docker run -d -p 8123:8123 --rm --name some-clickhouse-server -v /my/config/path/config.xml:/etc/clickhouse-server/config.xml --ulimit nofile=262144:262144 yandex/clickhouse-server:latest

Container successfully started, but when I try to connect to it by http curl 'http://localhost:8123' I have an error:

Failed to connect to localhost port 8123: Connection refused

When I connect to Clickhouse from Clickhouse-client (also using docker image) everything is OK

I ran Clickhouse-server image in -it mode, installed curl, started server and tried to connect clickhouse-server from inside of container, it's OK too

Also I tried to modify config.xml (which was copied from docker image) settings for listen_host (::, 0.0.0.0, ::1, 127.0.0.1) and for every setting I tried to connect by curl for localhost, 127.0.0.1, 0.0.0.0 - nothing of this solved my problem


Solution

  • I used Docker Toolbox on Mac OS (in conjunction with VirtualBox). So, I've migrated to Docker Desktop and this has solved my problem