Add info how to persist user data (#1977)

* Add info how to persist user data

* Improve wording

* Add note

* Better wording
This commit is contained in:
Ayaz Salikhov
2023-08-20 18:19:53 +02:00
committed by GitHub
parent cf9a8b6624
commit 948f0bb336
4 changed files with 36 additions and 6 deletions

View File

@@ -1,5 +1,27 @@
# Frequently Asked Questions (FAQ)
## How to persist user data
There are 2 types of data, which you might want to persist.
1. If you want to persist your environment (i.e. packages installed by `mamba`, `conda`, `pip`, `apt-get` and so on),
then you should create an inherited image and install them only once while building your Dockerfile.
An example for using `mamba` and `pip` in a child image is available
[here](./recipes.md#using-mamba-install-recommended-or-pip-install-in-a-child-docker-image).
```{note}
If you install a package inside a running container (for example you run `pip install <package>` in a terminal),
it won't be preserved when you next run your image.
To make it work, install this package in your inherited image and rerun `docker build` command.
```
2. If you want to persist user-data (files created by you, like `python` scripts, notebooks, text files and so on),
then you should use a
[Docker bind mount](https://docs.docker.com/storage/bind-mounts/) or
[Docker Volume](https://docs.docker.com/storage/volumes/).
You can find [an example of using bind mount here](./running.md#example-2).
There is also [a mount troubleshooting section](./troubleshooting.md#permission-denied-when-mounting-volumes) if you experience any issues.
## Why we do not add your favorite package
We have lots of users with different packages they want to use.