Access docker container files?

change to the directory you wish to access within the container

cd /webapp

Start the docker container in an interactive mode

docker run -it -v $(pwd):/mnt bash

This will create a new container from the specified image, and place you at a bash prompt within the container.

Within the container, copy to / from the /mnt directory

cp /mnt/webfile.* /www/html/
cp /var/log/logfile /mnt/logfile

exit the container

exit

list the files in /webapp

ls

They should reflect changes you made while in the container.

I don’t think that there is a way to do this for an already existing container. You could exec a shell within the running container and look at the files / directory structure, or use the docker cp command to copy files in and out of the container. I don’t think the container needs to be running to do this.