Docker: Difference between revisions
No edit summary |
|||
Line 3: | Line 3: | ||
Not ideal because it resets whenever you start the container. Need a better way: | Not ideal because it resets whenever you start the container. Need a better way: | ||
< | <code> | ||
sudo docker run -it -p 8888:8888 jupyter/pyspark-notebook jupyter notebook --no-browser --allow-root --ip=0.0.0.0 | sudo docker run -it -p 8888:8888 jupyter/pyspark-notebook jupyter notebook --no-browser --allow-root --ip=0.0.0.0 | ||
</ | </code> | ||
Then access it from a browser: | Then access it from a browser: | ||
< | <code>http://docker1.bpopp.net:8888 | ||
</ | </code> | ||
You'll need the token from the docker terminal the first time accessing the notebook. | You'll need the token from the docker terminal the first time accessing the notebook. | ||
Line 18: | Line 18: | ||
Get a list of running containers | Get a list of running containers | ||
< | <code>sudo docker ps</code> | ||
Find the id for your specific container: | Find the id for your specific container: | ||
< | <code> | ||
[bpopp@p1 pubs]$ sudo docker ps | [bpopp@p1 pubs]$ sudo docker ps | ||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
'''e0fd0ef0e5c0''' jupyter/all-spark-notebook "tini -g -- jupyter …" 22 hours ago Up 22 hours 0.0.0.0:8888->8888/tcp kind_sanderson | '''e0fd0ef0e5c0''' jupyter/all-spark-notebook "tini -g -- jupyter …" 22 hours ago Up 22 hours 0.0.0.0:8888->8888/tcp kind_sanderson | ||
</ | </code> | ||
< | <code>sudo docker exec -it e0fd0ef0e5c0 /bin/bash</code> |
Revision as of 13:55, 31 October 2019
Run
Not ideal because it resets whenever you start the container. Need a better way:
sudo docker run -it -p 8888:8888 jupyter/pyspark-notebook jupyter notebook --no-browser --allow-root --ip=0.0.0.0
Then access it from a browser:
You'll need the token from the docker terminal the first time accessing the notebook.
Get Shell to Container
Get a list of running containers
sudo docker ps
Find the id for your specific container:
[bpopp@p1 pubs]$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e0fd0ef0e5c0 jupyter/all-spark-notebook "tini -g -- jupyter …" 22 hours ago Up 22 hours 0.0.0.0:8888->8888/tcp kind_sanderson
sudo docker exec -it e0fd0ef0e5c0 /bin/bash