9

How to run docker images in google-colaboratory ? I tried to install docker service in google-colaboratory.

However, I got the error message about " Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?", when I executed the docker's commands.

screen-snap

I wonder How to solve this problem?

THX

CodeOverflow
  • 121
  • 1
  • 2
  • 5
  • are you using `sudo` to run docker commands ? or the user has been added in docker group ? it seems you are having permission issue. – chintan thakar Mar 27 '18 at 05:22
  • It has been the root user, and I cannot run "!sudo docker xxx" on the google colaboratory. – CodeOverflow Mar 27 '18 at 07:23
  • Install `docker.io` and run `dockerd -b none --experimental --iptables=0 --rootless`. See: [Docker is not running on Colab](https://stackoverflow.com/q/60235353/55075). – kenorb Oct 08 '20 at 13:20

1 Answers1

5

i think right now we can't use docker in collab, i tried instaling sudo and even runing de docker daemon with dockerd command and have no positive result.

my solution was to install all the dependencies of the image by hand like this:

!sudo apt-get update
!apt-get install -y wget bzip2
!apt-get install -y gcc perl git
!rm -rf /var/lib/apt/lists/*

!cd /
!mkdir anaconda
!cd anaconda
!wget https://repo.anaconda.com/archive/Anaconda2-5.2.0-Linux-x86_64.sh
!bash Anaconda2-5.2.0-Linux-x86_64.sh
!source ~/.bashrc
!cd ..
!rm -r anaconda

Community
  • 1
  • 1