Docker Community Forums

Share and learn in the Docker community.

Error trying mount a folder into docker container

im trying mount my folder with code in my container, i wanna change my code in my host and see changes in guest, but the folder where i mount my code in guest is empty

image 1

image2

image3

Text
In first image im running

docker run --name discord -it -v /c/xampp/htdocs/software/js/Pasante- bot:/usr/app/code bot

In second image im in the folder /usr/app/code INSIDE the container, im doing ls but the folder is empty

In third image im running

docker inspect discord

Output:

"Mounts": [
        {
            "Type": "bind",
            "Source": "/c/xampp/htdocs/software/js/Pasante-bot",
            "Destination": "/usr/app/code",
            "Mode": "",
            "RW": true,
            "Propagation": "rprivate"
        }
    ]

Something with this mount is not correct, it probably doesn’t work if you are in the MINGW64 console. Did you try the same with PowerShell?

docker run --name discord -it -v "$(pwd):/usr/app/code" bot