docker run -it --rm -v ${PWD}:/malware chadmando/dssuite
Returned this error:
docker: Error response from daemon: invalid mode: /malware.
UPDATE - This Fix Doesn't Solve the Problem
I confused silencing the error for fixing the problem. The error was gone but what I wanted, to mount the
PWD
to the container's/malware
, folder wasn't happening. See The Real Problem for the fix.
To fix the error, I found this question on Stack Overflow.
There are many opinions on how to fix the error.
I tried variations until I found the minimal change required.
docker run -it --rm -v '/${PWD}:/malware' chadmando/dssuite
The two changes that fixed the error:
Add the front slash/
before the${PWD}
Enclose the entire volume argument in single quotes'
I want to mount the current working folder to the docker container's /malware
folder.
I was using a PSDrive
aliased path in PowerShell.
New-PSDrive -Name "dev" -PSProvider FileSystem -Root C:\dev
Set-Location dev:\
I was at dev:\
and trying to mount to the container.
It wasn't happening.
After starting the container, no files from the local folder were visible in the container.
Docker didn't like the aliased path dev:\
.
I used Covert-Path
to move back to the Root.
Set-Location (Convert-Path $pwd)
This changed the $pwd to C:\dev
.
Now the local folder mounts to the container.