-1

I am using windows 10 home, so unable to install docker desktop; I need to install docker toolbox instead since windows 10 home does not have hyper v.

I also need to install influxdb and followed the tute below:

https://www.open-plant.com/knowledge-base/how-to-install-influxdb-docker-for-windows-10/

When I executed the following:

docker run -p 8086:8086 -v C:/ProgramData/InfluxDB:/var/lib/influxdb influxdb -config /var/lib/influxdb/influxdb.conf

It returns an error message below:

docker : C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: invalid mode: /var/lib/influxdb.
At line:1 char:1
+ docker run -p 8086:8086 -v C:/ProgramData/InfluxDB:/var/lib/influxdb  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (C:\Program File...r/lib/influxdb.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

I tried the solution in this url:

Docker Toolbox: Error response from daemon: invalid mode: /root/docker

by adding // instead of /, but it still does not work, and gives the same error message.

Can someone please assist? Thanks.

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94
jay
  • 1,055
  • 3
  • 15
  • 35

2 Answers2

1

The "mode" is referring to mount flags for the bind mount. The short syntax for a volume has components separated by colons. The first part is the source. The second part is the target inside the container. And the third part are the mount options. With only two colons you pass no flags. And without any colons you have an anonymous volume without a source.

So to break apart your volume mount, you have:

  • source: C (without a leading slash, this is a named volume rather than a host mount)
  • target: /ProgramData/InfluxDB
  • mount options: /var/lib/influxdb

With Windows, the complication is the drive syntax includes a colon after the drive letter. With docker, you can use slashes instead. And if you ever use git bash, you'll want those paths to use two leading slashes to avoid that apps behavior to convert those strings into a relative path. (Without git bash, the second leading slash isn't needed.) The result looks like:

 docker run -p 8086:8086 -v //c/ProgramData/InfluxDB:/var/lib/influxdb influxdb -config //var/lib/influxdb/influxdb.conf

Note the leading slash is important, but even more important is removing the colon after the drive letter.

BMitch
  • 231,797
  • 42
  • 475
  • 450
0

Try this:

docker run -p 8086:8086 -v /c/ProgramData/InfluxDB:/var/lib/influxdb influxdb "-config /var/lib/influxdb/influxdb.conf"

it might have to do with the bind path formatting and/or the dot in the file name under the -config command.

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94