Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a docker container directory accesible from host?

I have a tomcat running in a docker container and would like to watch was is going on in the webapps directory from the docker host. Is it possible to do this by mounting a volume without setting up a sshd in the container and without starting a shell inside?

like image 833
Gustave Avatar asked Sep 27 '22 06:09

Gustave


1 Answers

Instead of mounting volume, you could open a new bash in your running container with docker exec:

docker exec -it <id of running container> bash

That way, you can directly go to the folder managed by the webapp from within the container.

like image 159
VonC Avatar answered Nov 15 '22 13:11

VonC