Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save royalgarter/b0f58a033e372739ceea1f1cdecf89c3 to your computer and use it in GitHub Desktop.
Save royalgarter/b0f58a033e372739ceea1f1cdecf89c3 to your computer and use it in GitHub Desktop.

Revisions

  1. @mwufi mwufi revised this gist May 29, 2020. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions install_docker_in_colab.sh
    Original file line number Diff line number Diff line change
    @@ -16,8 +16,11 @@ sudo apt update -qq
    # Finally lets install docker with the below command
    sudo apt install docker-ce

    # Now lets check that docker is running
    sudo systemctl status docker
    # Lets check that docker is running
    docker

    # Originally, we did the following: (but doesn't work in Colab...)
    # sudo systemctl status docker

    # The output should be similar to this snippet below
    # ● docker.service - Docker Application Container Engine
  2. @mwufi mwufi revised this gist May 29, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions install_docker_in_colab.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    # First let's update all the packages to the latest ones with the following command
    sudo apt update
    sudo apt update -qq

    # Now we want to install some prerequisite packages which will let us use HTTPS over apt
    sudo apt install apt-transport-https ca-certificates curl software-properties-common
    sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq

    # After that we will add the GPG key for the official Docker repository to the system
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    @@ -11,7 +11,7 @@ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"

    # Next let's update the package database with our newly added Docker package repo
    sudo apt update
    sudo apt update -qq

    # Finally lets install docker with the below command
    sudo apt install docker-ce
  3. @mwufi mwufi created this gist May 29, 2020.
    35 changes: 35 additions & 0 deletions install_docker_in_colab.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    # First let's update all the packages to the latest ones with the following command
    sudo apt update

    # Now we want to install some prerequisite packages which will let us use HTTPS over apt
    sudo apt install apt-transport-https ca-certificates curl software-properties-common

    # After that we will add the GPG key for the official Docker repository to the system
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

    # We will add the Docker repository to our APT sources
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"

    # Next let's update the package database with our newly added Docker package repo
    sudo apt update

    # Finally lets install docker with the below command
    sudo apt install docker-ce

    # Now lets check that docker is running
    sudo systemctl status docker

    # The output should be similar to this snippet below
    # ● docker.service - Docker Application Container Engine
    # Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
    # Active: active (running) since Tue 2019-01-01 19:22:114 UTC; 1min 25s ago
    # Docs: https://docs.docker.com
    # Main PID: 10096 (dockerd)
    # Tasks: 16
    # CGroup: /system.slice/docker.service
    # ├─10096 /usr/bin/dockerd -H fd://
    # └─10113 docker-containerd --config /var/run/docker/containerd/containerd.toml

    # And now that everything is good, you should be able to do:

    # docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow