raju
raju

Reputation: 6936

passing dynamic path in docker run command

I am trying to use this command in docker run

docker run -p 80:80 -v $(pwd)/php-docker/src:/var/www/html/ php-hello-world

but it is not working. Is there any way to use pwd in docker run

Upvotes: 1

Views: 305

Answers (1)

Adiii
Adiii

Reputation: 59946

yes, you can use PWD, use it as variable $PWD instead subshell $(pwd)

docker run -p 80:80 -v $PWD/php-docker/src:/var/www/html/ php-hello-world

Upvotes: 2

Related Questions