Hvass-Labs / TensorFlow-Tutorials

TensorFlow Tutorials with YouTube Videos
MIT License
9.27k stars 4.19k forks source link

add Docker support #30

Closed ghost closed 7 years ago

Hvass-Labs commented 7 years ago

Thanks for the suggestion.

I have never used Docker myself, so I would like someone else to test if they can get this working on their machines as well.

@johndpope would you mind trying this? You talked about Docker in pull request https://github.com/Hvass-Labs/TensorFlow-Tutorials/pull/27

@sorend have you used Docker? Could you try if this works for you as well?

ghost commented 7 years ago

Thanks.

To test, please follow these steps: (See Makefile for details.)

Hvass-Labs commented 7 years ago

Thanks again for the pull request. It seems I will have to test it myself. I need to understand and test it better before I merge into master. As I have a lot of work at the moment and I haven't used Docker before, it'll be a while before I can get around to it. But I'll leave the issue open and you can update the files if you need to. Other people can download them as well if they need Docker support for these tutorials.

ghost commented 7 years ago

@Hvass-Labs Since you added requirements.txt in the last update, your tutorials now work with binder, you can run binder docker vm at this URL: http://mybinder.org/repo/hvass-labs/tensorflow-tutorials. If you have new code, just rebuild at this URL: http://mybinder.org/status/hvass-labs/tensorflow-tutorials

Here are a few screenshots of running binder vm on iPhone:

img_3808

img_3809

img_3810

Since the Docker solution is found, I will close this PR. For people who need a Dockerfile, they might want to use the binder version:

FROM andrewosh/binder-base:latest

RUN mkdir /home/main/notebooks
RUN chown main:main /home/main/notebooks
WORKDIR /home/main/notebooks
USER root
COPY . /home/main/notebooks/
RUN chown -R main:main $HOME/notebooks
USER main

RUN find $HOME/notebooks -name '*.ipynb' -exec jupyter trust {} \;

ADD requirements.txt requirements.txt
ADD handle-requirements.py handle-requirements.py
RUN python handle-requirements.py

USER main
WORKDIR $HOME/notebooks

Thanks for the good work.