Strange behavior, all content is deleted under jovyan home directory in few hours after docker container is started including jupyter_notebook_config file

Dear All,

I use jupyter notebook server and kernel to execute python and r script on the fly using websocket.

I have created docker container using below command.

FROM jupyter/r-notebook:3b1f4f5e6cc1
USER root
RUN mkdir /opt/notebook_dir

COPY jupyter_notebook_config.py /home/$NB_USER/.jupyter/
COPY requirements.txt /home/$NB_USER/

RUN chown $NB_USER -R /home/$NB_USER
RUN chown $NB_USER -R /opt/notebook_dir

EXPOSE 8888
ENTRYPOINT [“tini”, “-g”, “–”]
CMD [“start-notebook.sh”]

RUN conda install --yes --file /home/$NB_USER/requirements.txt
RUN fix-permissions $CONDA_DIR

USER $NB_USER

But I notice after few hours all content is deleted under /home/jovyan folder. Any idea what is deleting all this files/folders?

Here is my jupyter_config file

c.NotebookApp.ip = ‘0.0.0.0’
c.NotebookApp.token = ‘’
c.NotebookApp.password = ‘’
c.NotebookApp.allow_origin = ‘*’
c.NotebookApp.disable_check_xsrf = True
c.NotebookApp.notebook_dir = ‘/opt/notebook_dir/’
c.NotebookApp.open_browser = False

Here is my requirements.txt file

matplotlib==3.2.1
numpy==1.18.4
pandas==1.0.3
scipy==1.4.1
scikit-learn==0.23.1
statsmodels==0.11.1
seaborn==0.10.1

Any help in this matter is highly appreciated. do let me know if you need any other information.

Any suggestion/help on this matter will be highly appreciated.

Is it possible your Docker container is being automatically shut down or restarted?

Thanks Manics,

In docker-compose I did mentioned restart always. I am not sure in what scenarios it automatically get shutdown/restarted. Even if it restart, i am not sure why it is deleting all content which were added during image build.

Is your full docker-compose.yml available to look at?