(Closed) Create container inside a specific folder on local pc

5 months ago by
Hello everyone,
I am a newbie here and I have just pulled a docker image to my pc from my docker account. I can see the image with "docker image ls" and can create a container with it, however I want to create the container in a specific folder on my local pc where I can see/modify the code and I can visualise results with some post-processing tools. When I start docker container I want to see what is inside my folder (maybe some code I manually put there), so I can modify my code and run it.

I have been searching about this but anything I tried did not work. I would change my directory to the folder that I want to create the folder and then do a "docker run -ti -d <imagename>", this creates a container but not in the folder that I want, so when I run my code I do not know where to look for my results on my local pc.   

If someone can help me would be great.
Thanks in advance.
Community: FEniCS Project

This post is closed by moderator and no new answer/comment may be added.

Hi noname, this is not very related to FEniCS, try asking docker discussion channels or go through docker documentation.

written 5 months ago by Michal Habera  

1 Answer

5 months ago by
Answering my own question:

docker run -v /host/directory:/container/directory -t IMAGE-NAME /bin/bash

is the way to do it.
Please login to add an answer/comment or follow this question.
The thread is closed. No new answer/comment may be added.

Similar posts:
Search »