Docker Community Forums

Share and learn in the Docker community.

First time on docker


My question will seem stupid to you but I didn’t manage to solve my problem.

How to launch an image with a file selected on my pc as a parameter?

Let me explain :

I run :
docker run -ti imiell/bash2py

And i would like run this


my script is on my computer "C:\Users\eqx1\bash2py-3.6\"

You could achieve this by sharing a volume between your computer and the Docker container.

Something like this should work:

docker run --rm -it -v C:\Users\eqx1\bash2py-3.6:/app imiell/bash2py bash -c /app/

The -v flag will map a volume from C:\Users\eqx1\bash2py-3.6 on the host (i.e., your PC) to a folder called /app inside the container. Then the parameter bash -c /app/ will run a bash shell passing /app/ as an argument which should be mapped to the /app folder from your PC.

BTW, the --rm option will remove the container after it exists so that you don’t have to do this manually.

Feel free to ask more questions if this explanation isn’t clear.