Invalid volume specification trying to run portain

2019-08-29 09:59发布

问题:

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?

回答1:

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.