2

I am trying to bring a github repo into my Google Colab workspace via the following code:

!git clone https://github.com/vanvalenlab/deepcell-tf.git
!cd deepcell-tf
!docker build -t $USER/deepcell-tf .

I have followed Google Colab's steps for install Docker (https://colab.research.google.com/drive/10OinT5ZNGtdLLQ9K399jlKgNgidxUbGP).

But when I run the above code, I get the following error:

invalid argument "/deepcell-tf" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.

"-t" is a valid argument to pass according to the documentation. Why does it think I'm passing /deepcell-tf as an argument?

oofin
  • 160
  • 1
  • 2
  • 12

2 Answers2

2

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 .
Eduardo Baitello
  • 10,469
  • 7
  • 46
  • 74
  • That definitely makes sense. After reading this, I tried `!docker build -t content/deepcell-tf .` and I get the error: `ERRO[0000] failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: connection refused error during connect:` I had started the Docker by running `!/etc/init.d/docker start`, so I'm not sure how this could happen – oofin Nov 04 '19 at 18:39
  • This error generally means that your docker daemon is not running, or that your user doesn't have proper permissions. You can retry it appending `sudo` to your command or by [adding your user to `docker` group](https://stackoverflow.com/a/38157703/7641078) (you will need to restart after this). – Eduardo Baitello Nov 04 '19 at 18:43
0

The notebook you linked isn't actually published by Google, it was just made by another user.

Google Colab doesn't support Docker, and they currently have no plans to support it, unfortunately: https://github.com/googlecolab/colabtools/issues/299

rchurt
  • 1,395
  • 1
  • 10
  • 21