Installing Docker in Linux

IMPORTANT: Docker needs root access to be installed! Non sudo users cannot install docker

1) Download the .deb file for docker.io for your version of linux

To find the release version of your Linux OS

lsb_release -a

o/p:

Distributor ID: Debian
Description:    Debian GNU/Linux 9.5 (stretch)
Release:    9.5
Codename:   stretch

For this OS, you ll have to look under debian/stretch/pool/stable

o/p:

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:    14.04
Codename:   trusty

For this OS, you ll have to look under ubuntu/trusty/pool/stable

You may also have to know the processor arch amd64 or arm64, which can be found by hitting

uname -a

2) Dependencies

If you are on Google cloud VM instance, you ll have to install

sudo apt-get install libltdl7

Sometimes you may need to install this (Ubuntu 16.04),

sudo apt-get install libseccomp2

Note: In ubuntu 16.04, installing this automatically installed docker

Installation

Install the .deb file

sudo dpkg -i docker-ce_18.03.1~ce-0~debian_amd64.deb

3) Check installation

sudo docker run hello-world

To use docker without sudo, you ll have to add the user to docker group, logout and login

sudo usermod -aG docker $USER

Note: Or you can do this to avoid login and logout

sudo setfacl -m user:username:rw /var/run/docker.sock

Reference

Installing docker-compose

(Not needed for TensorflowDocker)

Docker compose is used for networking between different containers in the host system

To install, you just have to place the binary in the bin folder (for updated version, check release doc

sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Set permission for this binary to be executable

sudo chmod +x /usr/local/bin/docker-compose

Check installation

docker-compose --version