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 /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

ENTRYPOINT [“tini”, “-g”, “–”]
CMD [“”]

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


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 = ‘’
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


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?