0
votes

I've been trying to mount a volume to a docker container with clickhouse, specifically on docker desktop windows 10. Following the documentation:

https://hub.docker.com/r/yandex/clickhouse-server/

I have no problem setting up the docker container on my C drive which is in my $HOME path and loading data into etc. I want to now mount a custom volume, my E/ drive which is larger as the database will continue to grow. I am getting an error when I run this:

docker run -d -p 8123:8123 --name clickhousedb --ulimit nofile=262144:262144 --volume=/E:/ch/clickhousedb:/var/lib/clickhouse yandex/clickhouse-server

specifically this:

Error response from daemon: invalid mode: /var/lib/clickhouse.

Any ideas what might be the issue?

2

2 Answers

0
votes

The issue is the "/" character right after " --volume=", which tells the docker CLI to split the string as:

  • empty string (directory to be mounted)
  • E:/ch/clickhousedb (mounting point inside the container)
  • /var/lib/clickhouse (mounting mode)

Docker thought "/var/lib/clickhouse" was the mode for the volume mount, hence the error message.

-1
votes

Seemed to be a permission issue. Was able to access the root of the E drive:

docker run -d -p 8134:8123 --name clickhousedb --ulimit nofile=262144:262144 --volume=E:/:/var/lib/clickhouse yandex/clickhouse-server