How can I access a file inside the docker image?

If I create a file inside the docker image. How can I access it from outside?

For example:

/var/discourse/launcher enter app
touch temp.txt
^D

How can I access temp.txt?

1 Like

Try man docker

docker cp

1 Like

Where can I find my containerId?

Docker ps

You really should look at man docker

1 Like

You’ll need to back up and say what actual problem you’re trying to solve, as what you describe is probably not the solution. The answer to your question is that the stuff in /shared in the container is accessible as /var/discourse/shared/standalone in a standard install, but this is probably not a solution to your unstated problem.

6 Likes

Thanks, Jay. I’m running a rails query and would like to export the output. I would normally use the Data Explorer, but for this report I wanted to use Rails directly.

Ha! Then this will work! You might stick it in the backups directory, as there isn’t much there so it’ll be easy to keep up with.

4 Likes