Wie kann ich auf eine Datei innerhalb des Docker-Images zugreifen?

Wenn ich eine Datei innerhalb des Docker-Images erstelle, wie kann ich von außen darauf zugreifen?

Zum Beispiel:

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

Wie kann ich auf temp.txt zugreifen?

1 „Gefällt mir“

Try man docker

docker cp

1 „Gefällt mir“

Where can I find my containerId?

Docker ps

You really should look at man docker

1 „Gefällt mir“

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 „Gefällt mir“

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 „Gefällt mir“