Skip to content

Instantly share code, notes, and snippets.

@Nikasa1889
Last active October 3, 2018 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nikasa1889/6c35011236bb6b5c1213fcff33b008f4 to your computer and use it in GitHub Desktop.
Save Nikasa1889/6c35011236bb6b5c1213fcff33b008f4 to your computer and use it in GitHub Desktop.
Run an Adhoc Jupyter service for datascience
# Run the following command to start jupyter with custom password
## The current directory will be mapped to the /home/jovyan in the docker
## User is granted root access
## New password can be set using its hash, hash of password can be obtained by:
### from IPython.lib import passwd
### passwd("this_is_a_password") #Output: 'sha1:9743a64265c5:5775f49cb5577d50234260a661cb520b1dc07ed3'
docker run -p 8888:8888 --user root -e NB_GID=100 -e GRANT_SUDO=yes -v "$PWD":/home/jovyan jupyter/scipy-notebook:hoangmt start-notebook.sh --NotebookApp.password='sha1:9743a64265c5:5775f49cb5577d50234260a661cb520b1dc07ed3' -d
# Save changes to the running container by commiting its image
# get hash of the container to be commited
docker ls
# Assume 986ec99cd7ce is the container you want to save
docker commit 986ec99cd7ce jupyter/scipy-notebook:hoangmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment