Running Docker on Google Colab

Running Docker on Google Colab

I was disappointed to find that Docker is not supported on Google Colab, and Google has no plans to support it.

https://github.com/googlecolab/colabtools/issues/299

Building Docker container in Google Colab: unknown flag -t

The -t is indeed a valid flag:

--tag , -t Name and optionally a tag in the name:tag format

The problem is that your $USER variable is not set, and your command is being interpreted as docker build -t /deepcell-tf ., which is an invalid form for naming the image.

You need to make sure to export the $USER value before running the docker build, or setting it manually to a valid value. E.g.:

docker build -t my-user/deepcell-tf .

How to connect google colab with localhost running docker image?

I can't see the full screen but most likely the error in colab is because it is hosted on remote server by Google research where as the http://localhost:7700/ is on your local system.

You can't connect them using http://localhost:7700/.
And if you have also used your machines ip address, that is http://192.168.43.57:7700 and can't connect then did you first expose your port number 7700 to internet?

You will need to expose your local machine and some ports(7700) using different services which provide the required.

You can read the following article on how to setup tunneling service or ssh to expose the local development on internet.

Medium Article on How to expose a local development server to the Internet

Or use this directly. Use local tunnel

How to use Google Colab with a local TensorFlow Jupyter server using Powershell on Windows 10?

Alright, after a few hours of searching around I found out how to overwrite a docker image default CMD to append the "--NotebookApp.allow_origin='https://colab.research.google.com'" and it worked!

So the solution is:

docker run -it -p 8888:8888 tensorflow/tensorflow:latest-py3-jupyter jupyter notebook --notebook-dir=/tf --ip 0.0.0.0 --no-browser --allow-root --NotebookApp.allow_origin='https://colab.research.google.com'


Related Topics



Leave a reply



Submit