Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Trying $pwd in docker run command
PS E:\test> docker run --rm -it -v $pwd.path:/data mirkohaaser/docker-clitools ls -la
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error parsing reference: ":/data" is not a valid repository/tag.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
PS E:\test> docker run --rm -it -v $pwd:/data mirkohaaser/docker-clitools ls -la
In Zeile:1 Zeichen:24
+ docker run --rm -it -v $pwd:/data mirkohaaser/docker-clitools ls -la
+ ~~~~~
Ungültiger Variablenverweis. Nach ":" folgte kein Zeichen, das für einen Variablennamen gültig ist. Verwenden Sie ggf. "${}", um den Namen zu begrenzen.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidVariableReferenceWithDrive
PS E:\test> docker run --rm -it -v ($pwd.path):/data mirkohaaser/docker-clitools ls -la
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error parsing reference: ":/data" is not a valid repository/tag.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.