Docker-stacks: GRANT_SUDO=yes still doesn't seem to work

Created on 29 Nov 2018  路  2Comments  路  Source: jupyter/docker-stacks

Sorry, this is an issue that doesn't seem to die. I would like to add some JARs via sudo. Perhaps there is a better way to do that but sudo would come in handy for other tasks.

(1)
docker run -d -v $PWD:/home/jovyan/work -e GRANT_SUDO=yes -p 8888:8888 jupyter/all-spark-notebook

(2)
Get the container id via:

docker ps

(3)
docker exec -it __containerid__ bash

(4)
sudo ls

Prompts for password for user jovyan

Question

Most helpful comment

Thanks. An example would be sufficient rather than adding more prose to the docs. Does this look correct? (yes, it works)

docker run -d -v $PWD:/home/jovyan/work -e GRANT_SUDO=yes --user root -p 8888:8888 jupyter/all-spark-notebook

Not sure why anyone would want to do this, but if you want to run a shell in the container as jovyan instead of root and use sudo when needed: docker exec --user jovyan -it _container_id_ bash

All 2 comments

Try adding --user root to your run command. The doc for GRANT_SUDO explains why (https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html). Maybe we can make it clearer since it seems to trip a lot of people up.

Thanks. An example would be sufficient rather than adding more prose to the docs. Does this look correct? (yes, it works)

docker run -d -v $PWD:/home/jovyan/work -e GRANT_SUDO=yes --user root -p 8888:8888 jupyter/all-spark-notebook

Not sure why anyone would want to do this, but if you want to run a shell in the container as jovyan instead of root and use sudo when needed: docker exec --user jovyan -it _container_id_ bash

Was this page helpful?
0 / 5 - 0 ratings

Related issues

statiksof picture statiksof  路  4Comments

tarelli picture tarelli  路  4Comments

iramsey85 picture iramsey85  路  4Comments

jbn picture jbn  路  3Comments

edurenye picture edurenye  路  4Comments