- Step 1. Create a Directory at an appropriate place in your Linux Environment with 755 privileges (Not advisable for production)
mkdir -m 755 DockerExample
- Step 2. Go inside the newly created Dir. This Directory would act as a shared folder with the new Docker Container:
cd DockerExample
- Step 3. Now as our original goal is to run the Jupyter Notebook from the Docker container, we need to expose the port of Jupyter server to the host. Run below command in your terminal
sudo docker run -v$(pwd):/sharedfolder --name=jNotebook -p 9294:8888 -i -t ubuntu
- Now you must be inside Docker Container. Validate "sharedfolder" folder by
ls –a
"sharedfolder" is the folder which is shared with Host OS/
- Step 4. Copy script from
- https://raw.githubusercontent.com/dhnanjay/useful_scripts/master/JupyterfromDocker.sh
- Save it in a textfile with the name JupyterfromDocker and with an extension .sh (which means the full name of the file should be JupyterfromDocker.sh) inside DockerExample directory.
- Step 5. Change Script Permissions:
- Before running the script, ensure it has all the permission and is executable. See the below screenshot to make it executable
- Step 6. Find script
- Now go back to the Docker container and in the terminal, go the sharedfolder directory to verfiy if the script is there or not.
- cd sharedfolder
- ls -a
- Step 7. Run script and do ensure to press y wherever necessary(Its an interactive script)
- ./JupyterfromDocker.sh
- Configure TimeZone and Geo Location
- Step 8. Once the scripts runs successfully, you should see the below output: