I am new to Docker. In order to take the Udacity Deep Learning course, I had to set up TensorFlow on my Windows machine using Docker. (Although TensorFlow is now available on Windows, it only supports Python 3.5, however the Udacity course material requires Python 2.7. Therefore, I have to stick with the Docker way of using TensorFlow.)
To work on the assignments, I followed the instructions here as detailed below:
- First, I installed docker toolbox.
- Then, I launch Docker using the Docker Quickstart Terminal. For the first time, I ran:
docker run -p 8888:8888 --name tensorflow-udacity -it gcr.io/tensorflow/udacity-assignments:0.6.0
.
Each time after, I just run this in my docker terminal:
docker start -ai tensorflow-udacity
- Finally, in the address bar, with
http://192.168.99.100:8888
I get the assignment Jupyter notebooks up and running (see image below).
However, what I want now is to run the final project of the course which is not part of the pre-built Udacity docker image. How can I do that? The final project can be found here, with the "digit_recognition.ipynb" specifically being the file to run in docker.
Any guidance is much appreciated.
First of all, you need a way to get this Jupyter notebook (final project) on your Docker instance.
What is an easy way to copy a file inside of a Docker container? Well, not a lot.
I am going to detail the last one, but, don't forget that there are many solutions to one problem.
How do we enter in the Docker container?
How can we get the
[container-id]
?It will show you a list of containers, match the one you want to enter in.
Once you're in your container. How can we download the file we want?
We should try to figure out if we have
wget
orcurl
utilities to download a file. If we don't, we have to install them from any package manager available (tryapt-get
, if it works, do:apt-get install wget
).Once we have something to download files from the Internet, we have to find out where the notebooks are stored. That is the difficult part.
Look for any folder which might contain, there could also be some kind of magic one liner to type using
find
, unfortunately, I am no magic wizard anymore.Let's assume you are in the good folder.
That's all! Reload your page and you should see the notebook displayed.
Side-note: You might also need to install extra dependencies in the container.
An alternative and much easier way is this:
That's it. Whatever changes you make will be retained and you'll be able to see the new file in the container going forward!