AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Docker For Mac Jupyter Notebook9/29/2020
Now that weve run that and created a new notebook, lets check the local directory we connected to the notebook to see if our linear model notebook was saved correctly.Github is great, but, if you have ever tried to run some random persons code you found on there, it usually takes at least a few days to get it to work even though its the same exact code they had working.
They might have had a different version of a library used or some other minor difference, but that could mean a lot of work to get everything to work on your computer. Docker basically allows all of these libraries and dependencies used in the code you want to run to be turned into a Docker image. You can then use this Docker image to essentially recreate the environment necessary to run their code. Once docker toolbox is installed, there will be a shortcut icon on the desktop of your computer. If you have a firewall, you might need to disable it now and re-enable it when done with Jupyter Notebook. I also had to go into the BIOS and enable virtualization for this to work. The Docker whale will appear when Docker is ready (this part sometimes takes a few minutes). The next step in getting a Jupyter Notebook running on Docker is to find a Docker image that has the libraries and things that you want. The one Im using is one we set up on Docker hub called mpcrlearn. ![]() On the right, it gives you the Docker pull command to get these: mpcrmpcrlearn. To do that we need to set up two things, a Dockerfile and a file called docker-compose.yml. I created a folder in my home directory called Docker (you can choose whatever name you want) to put these in. I would do cd Docker to get to my folder since mines name is Docker. The second line through sixth line leave the same too (if you didnt use the mpcr Docker image, change line three). The 8888:8888 just tells us what port the Jupyter Notebook is going to get mapped to. Each one of those lines essentially connects a directory on my laptop with a remote directory where well be working. ![]() You can change the first part before the colon to whatever folder you want to save work in, but leave the part after the colon the same. The other line under volumes just saves my jupyternotebookconfig.py file on the local directory too. Docker Jupyter Notebook Password On MyI added it because I modified the config file to get a password on my notebook, and I wanted the password to be remembered after closing Docker. You can just create a file called jupyternotebookconfig.py on your computer and put the directory to that file in place of the directory I have before the colon. While in the terminal, make sure you are in the directory where your Dockerfile and docker-compose.yml file are located. So I would type 192.168.99.100:8888 into the address bar in Chrome.
0 Comments
Read More
Leave a Reply. |