microsoft / CloudAdoptionFramework

Code samples and extended documentation to support the guidance provided in the Microsoft Cloud Adoption Framework
https://aka.ms/CAF
Creative Commons Attribution 4.0 International
864 stars 621 forks source link

mount error when running docker run command #145

Closed jpcapone closed 1 year ago

jpcapone commented 1 year ago

i followed the instructions pretty closely but i must be missing something. When i get to the part for actually bringin up the dockedr i get the following result:

PS C:\docker\CloudAdoptionFramework-master\ready\AzNamingTool> docker run -d -p 8081:80 --mount source=azurenamingtoolvol,target=/app/settings azurenamingtool:latest

docker : docker: Error response from daemon: invalid mount config for type "volume": invalid mount path: '/app/settings'.
At line:1 char:1
+ docker run -d -p 8081:80 --mount source=azurenamingtoolvol,target=/ap ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (docker: Error r.../app/settings'.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

See 'docker run --help'.

Any suggestions would be appreciated.

BryanSoltis commented 1 year ago

Hi @jpcapone,

Thank you for the feedback. I have not heard of this issue before, so I'm a little confused as to why the --mount command would fail. The docker command will create a volume and mount it for the container for the persistent storage of files. This may be due to a configuration in your environment, or some other cause.

An alternative may be to use the -v (volume) command instead. Here is the syntax:

docker run -d -p 8081:80 --name azurenamingtool -v azurenamingtoolvol:/app/settings azurenamingtool

Let me know if this allows the container to launch properly. Thank you!

-Bryan

jpcapone commented 1 year ago

Thanks for your response. I can say that my install is a fresh deployment of Windows Server 2022. and I was able to install portainer using the docker run command.
PS C:\docker\CloudAdoptionFramework-master\ready> docker run -d -p 8081:80 --mount source=azurenamingtoolvol,target=/app/settings azurenamingtool:latest docker : docker: Error response from daemon: invalid mount config for type "volume": invalid mount path: '/app/settings'. At line:1 char:1 any further suggestions would be appreciated.

BryanSoltis commented 1 year ago

Ah, it may be that Portainer has a different syntax/capability than standard Docker (which is what the installation instructions are for). I would recommend trying the modified command I posted above using the -v switch to see if that works.

-Bryan

jpcapone commented 1 year ago

Ah, it may be that Portainer has a different syntax/capability than standard Docker (which is what the installation instructions are for). I would recommend trying the modified command I posted above using the -v switch to see if that works.

-Bryan

Oh sorry for the confusion. I am running the command from the powershell cli. That is when i generate this error: docker : docker: Error response from daemon: invalid mount config for type "volume": invalid mount path: '/app/settings'. At line:1 char:1 I mentioned the portainer install just to confirm that the docker environment is working. Here is the output from the command line for the docker version

PS C:\docker\CloudAdoptionFramework-master\ready> docker --version Docker version 20.10.9, build 591094d

BryanSoltis commented 1 year ago

This issue has been closed due to inactivity.