Search code examples
bashshelldockerparametersfish

Passing parameter in docker build command with fish


Using Docker For Mac, fish shell, macOS 10.11

I am trying to run the following command: docker run -d -it --name=my-app-container -v $(pwd):/app -p 3000:3000 myapp

I get the following error:

$(...) is not supported. In fish, please use '(pwd)'.
fish: docker run -d -it --name=my-app-container -v $(pwd):/app -p 3000:3000 myapp

Been reading through repos and SO answers but cant get this to work. Any ideas? Thank you.


Solution

  • The equivalent of bash $(command) in fish is just (command)

    So all you need to do is remove the dollar sign.

    docker run -d -it --name=my-app-cont -v (pwd):/app -p 3000:3000 myapp