Mount current directory as a volume in Docker on Windows 10

后端 未结 10 1014
滥情空心
滥情空心 2020-11-28 01:22

Description

I am using Docker version 1.12.5 on Windows 10 via Hyper-V and want to use container executables as commands in the current path. I buil

10条回答
  •  感情败类
    2020-11-28 01:41

    docker run --rm -v /c/Users/Christian/manager/bin:/app --workdir=/app  php:7.2-cli php  app.php
    

    Git bash

     cd /c/Users/Christian/manager
        docker run --rm -v  ${PWD}:/app  --workdir=/app  php:7.2-cli php  bin/app.php
    

    echo ${PWD} result:

    /c/Users/Christian/manager

    cmd or PowerShell

      cd C:\Users\Christian\manager
    

    echo ${PWD} result:

    Path ---- C:\Users\Christian\manager

    as we see in cmd or PowerShell $ {PWD} will not work

提交回复
热议问题