Skip to content

Commit

Permalink
fixed volume mounting in toolbox; added ip discovery in toolbox mode
Browse files Browse the repository at this point in the history
  • Loading branch information
datamove committed Feb 2, 2019
1 parent f52724d commit 1f97018
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions run_jupyter.cmd
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@

REM
REM Attention: Windows Toolbox users - you MUST put the course repo in C:\Users\%username\mlcourse.ai
REM Attention: Use Ctrl-C to shut down. If you close the window, the container may still be running.
REM

SET IMAGE="datamove/mlcourse_ai"

REM check for new versin of the image
docker pull %IMAGE%

IF DEFINED DOCKER_TOOLBOX_INSTALL_PATH (
docker run -it --rm -u 1000:1000 -v /c/users/%username%/mlcourse.ai:/notebooks -w /notebooks -e HOME=/notebooks/home -p 4545:8888 %IMAGE% jupyter-notebook --NotebookApp.ip=0.0.0.0 --NotebookApp.password_required=False --NotebookApp.token='' --NotebookApp.custom_display_url="http://localhost:4545"
FOR /F "tokens=* USEBACKQ" %%a in (`"docker-machine ip default"`) DO SET JUP_IP=%%a
)

IF DEFINED DOCKER_TOOLBOX_INSTALL_PATH (

docker run -it --rm -u 1000:1000 -v /c/Users/%username%/mlcourse.ai:/notebooks -w /notebooks -e HOME=/notebooks/home -p 4545:8888 %IMAGE% jupyter-notebook --NotebookApp.ip=0.0.0.0 --NotebookApp.password_required=False --NotebookApp.token='' --NotebookApp.custom_display_url=http://%JUP_IP%:4545

) ELSE (

docker run -it --rm -u 1000:1000 -v %cd%:/notebooks -w /notebooks -e HOME=/notebooks/home -p 4545:8888 %IMAGE% jupyter-notebook --NotebookApp.ip=0.0.0.0 --NotebookApp.password_required=False --NotebookApp.token='' --NotebookApp.custom_display_url="http://localhost:4545"
)

REM
REM Attention: Windows Toolbox users - you MUST put the course repo in C:\Users\%username\mlcourse.ai
REM Attention: Windows Toolbox users - check your URL in the docker controls.
REM Attention: Use Ctrl-C to shut down. If you close the window, the container may still run.
REM


0 comments on commit 1f97018

Please sign in to comment.