Dan P.
Dan P.

Reputation: 25

How can I make Docker Images / Volumes (Flask, Python) accessible for my host machine (macOS)?

I am running the latest macOS (Sierra) with Docker and Kitematic installed. I am also using Virtualbox for emulation.

I want to use the uwsgi-nginx-flask image but I have no idea how I can make the python files and the nginx directory inside my container accessible from outside the virtual machine ?

Haven't found anything about that on the website either.

Upvotes: 0

Views: 563

Answers (2)

lakshayk
lakshayk

Reputation: 121

Folders between the host and containers can be mapped and mounted by using the -v tag during runtime.

$ docker run -it -v /host/directory:/container/directory imagename:tag

You can alternatively use docker cp to copy stuff inside and outside of the container. For example

$ docker cp /path/to/file ContainerName:/path/inside/container

or

$ docker cp ContainerName:/path/inside/container/file .

Upvotes: 1

vegiops
vegiops

Reputation: 311

you can mount the host directory to docker container which will be shared between host and docker

docker run --name container_image -d -v ~/host_dir:/container_dir docker_image

Upvotes: 0

Related Questions