Score:0

Copying docker host files from host to local - is it possible?

sz flag
# docker exec -it id bash

By this command we can move inside a container and find files in it. Inside this how can we write a python script or shell script so the files inside this will move to local. When ever a new file is being generated.

Artur Meinild avatar
vn flag
And more importantly, what are you trying to achieve? Why not use persistent volumes?
kanehekili avatar
zw flag
@Artur Meinild Thanks for formatting - i didn't see the question. The answer is to create an persistent volume and a CMD entry in your dockerfile. The python script needs to be copied into your container with the COPY command. [Documentation](https://docs.docker.com/engine/reference/builder/)
dummyuser avatar
uy flag
this seems a pretty unclear question. the command `docker cp <source> <destination>` might be too easy as answer.
Harshavardhan Reddy avatar
sz flag
can you help with python script or shell script
Artur Meinild avatar
vn flag
Please explain what your purpose is, before anyone uses time for something that might be in vain.. Why do you need to copy data from your container to the system?
Harshavardhan Reddy avatar
sz flag
Without switching the path i want to view the files present in it.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.