-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for JUPYTER_TOKEN_FILE #5587
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good and address a valid use case - one we're seeing more of these days with containerization. Thank you!
Hi @nemesisflx - I'm wondering if we should use this opportunity to extend the help test to reference both |
@kevin-bates I am unsure what you mean by your request. Both |
I'm referring to the help text relative to the I think it would be helpful to note that |
@kevin-bates I updated the description. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good - thanks for adding the help text.
Motivation
Currently, we use
JUPYTER_TOKEN
as an environment variable to pass a token to the jupyter notebook with which we can authenticate us later. This is a good practice, for a local environment, but in a docker environment the best practice is to usedocker secrets
. Docker secrets uses instead of a string directly in the env variable, a file location where the string is stored. This file is stored in memory and only accessible by the container that has the correct access right.Changes
Added an env variable
JUPYTER_TOKEN_FILE
, if it is available it will read the token from the given location and return it. Priority hasJUPYTER_TOKEN
.Further information
Docker-compose with docker secret, best practices: https://docs.docker.com/engine/swarm/secrets/#build-support-for-docker-secrets-into-your-images