Docker Community Forums

Share and learn in the Docker community.

Load ~/.bashrc or ~/.profile before starting the jupyter notebook

I am trying to set up my own environment using the standard jupyter/base-notebook (on ubuntu) as the base Docker image. To do, that I need to load a config shell script (.sh) file before starting the notebook in the default fashion using CMD[] I put ‘source ~/’ in the ~/.bashrc and the ~/.profile but it seems it does not work and I can not import my python modules in the notebook. Any tip to load ~/.bashrc (~/.profile) before the jupyter notebook being started?

Cant you source it in the beginning of “” script?

Tanx, I have tried that and it gave me a ‘permission denied’ error. Do you have any tips to source a ~/.bashrc or ~/.profile from a shell script file?