0

I'm trying to deploy portainer to my local docker. I'm running the Docker CE 18.0.6.0 version on Windows 10. I tried to follow the steps from these two pages:

  1. Portainer-Deployment

  2. Tutorial: Portainer for local Docker environments on Windows 10!

But all the times I have tried to run the following command:

docker run -d -p 9000:9000 --name portainer --restart always -v portainer_data:/data portainer/portainer -H tcp://10.0.75.1:2375

Docker responds always with the same message:

Error response from daemon: invalid volume specification: 'portainer_data:/data'

I created the volume using this command:

docker volume create portainer_data

Any idea what could be?

ocuenca
  • 38,548
  • 11
  • 89
  • 102
  • Check your underscore, delete it and type it again by hand. – BMitch Aug 06 '18 at 17:37
  • let me try that and I let you know the result – ocuenca Aug 06 '18 at 17:38
  • I removed the volume and create a new one without `_data` and the same result:`Error response from daemon: invalid volume specification: 'portainer:/data'` – ocuenca Aug 06 '18 at 17:43
  • Those commands look right to me. This often means some other non-printable character got into the command. – BMitch Aug 06 '18 at 17:48
  • I also went to the folder where I created the volume, I opened a console and I tried to run the command this time using `-v $(pwd):/data` but nothing. Do I need to specify the second part different, eg, C:\\data instead of /data? – ocuenca Aug 06 '18 at 17:48
  • I tried to use `mount` instead (`--mount source=portainer,target=/data`) and this time and this time this was the error:invalid mount config for type "volume": invalid mount path: '/data'. That's why I think my error is in the target part – ocuenca Aug 06 '18 at 18:10
  • Are you running Linux containers? – BMitch Aug 06 '18 at 18:14
  • No, windows containers. Do I need to switch? – ocuenca Aug 06 '18 at 18:15
  • 2
    There's the issue. Switch the engine back to Linux containers and it should work. Or you'll need a different syntax for Windows – BMitch Aug 06 '18 at 18:17
  • OK, I did it and it worked this time but I'm curious how can be done in windows container.Do you know what changes I need to do? – ocuenca Aug 06 '18 at 18:23

1 Answers1

6

The path syntax you used only works for Linux containers since Linux environments only have a single root to their filesystem tree. To run portainer container in a native Windows container, the syntax is:

docker run -d -p 9000:9000 --name portainer --restart always -v \\.\pipe\docker_engine:\\.\pipe\docker_engine -v C:\ProgramData\Portainer:C:\data portainer/portainer

This comes from the deployment documentation.

BMitch
  • 231,797
  • 42
  • 475
  • 450
  • Yes , what confused me was the second link I quoted in my question, thank you sir – ocuenca Aug 06 '18 at 18:46
  • 1
    @octavioccl You'll find that most documentation on docker containers is Linux focused. Windows containers are relatively new and I don't believe they've gotten all the same functionality working yet. – BMitch Aug 06 '18 at 18:48