0

I have this docker command for mac os:

docker run --name digital-contracts-phpmyadmin -p 4599:80 -v $(pwd)/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php -v $(pwd)/phpmyadmin/config.user.extra.php:/etc/phpmyadmin/config.user.extra.php --network digital-contracts-mysql-net -d phpmyadmin/phpmyadmin

however when i run it on windows os on command prompt (cmd.exe), i get this error:

docker: Error response from daemon: create $(pwd)/phpmyadmin/config.user.inc.php: "$(pwd)/phpmyadmin/config.user.inc.php" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.

Please help me modify the command to run it successfully on windows os

thanks!

  • `pwd` is a POSIX thing. You need the equivalent for your shell, but you need to specify: `cmd.exe` or PowerShell? – tadman Nov 10 '20 at 03:17
  • I am using cmd.exe! – optimusprime Nov 10 '20 at 03:19
  • Option 1 is Windows Subsystem for Linux using bash. Option 2 is to [translate this to CMD notation](https://stackoverflow.com/questions/921741/windows-equivalent-to-unix-pwd). – tadman Nov 10 '20 at 03:21

1 Answers1

1

CMD:

docker run --name digital-contracts-phpmyadmin -p 4599:80 -v %CD%/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php -v %CD%/phpmyadmin/config.user.extra.php:/etc/phpmyadmin/config.user.extra.php --network digital-contracts-mysql-net -d phpmyadmin/phpmyadmin

PowerShell:

Edit: fixing curly braces

docker run --name digital-contracts-phpmyadmin -p 4599:80 -v ${pwd}/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php -v ${pwd}/phpmyadmin/config.user.extra.php:/etc/phpmyadmin/config.user.extra.php --network digital-contracts-mysql-net -d phpmyadmin/phpmyadmin
SBdev
  • 101
  • 1
  • 5
  • hi. thanks for the answer. i tried using the powershell command however i get docker invalid reference format error! – optimusprime Nov 10 '20 at 03:32
  • sorry, copied the original, try: docker run --name digital-contracts-phpmyadmin -p 4599:80 -v ${pwd}/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php -v ${pwd}/phpmyadmin/config.user.extra.php:/etc/phpmyadmin/config.user.extra.php --network digital-contracts-mysql-net -d phpmyadmin/phpmyadmin – SBdev Nov 10 '20 at 03:40