Skip to content

Latest commit

 

History

History
97 lines (79 loc) · 1.84 KB

11-setting-up-docker.md

File metadata and controls

97 lines (79 loc) · 1.84 KB

Setting Up Docker

How to setup Docker on Raspberry Pi 3 Model B+

Prerequisite(s):

pi@raspberry:~ $ sudo apt-get install apt-transport-https ca-certificates software-properties-common -y

1 - Configure Linux Configuration Group


pi@raspberry:~ $ sudo nano /boot/cmdline.txt

Append following line

cgroup_enable=memory cgroup_memory=1 cgroup_enable=cpuset swapaccount=1

Ctrl+X -> Y -> Enter

pi@raspberry:~ $ sudo reboot
pi@raspberry:~ $ sudo cat /proc/cgroups

2 - Install Docker


pi@raspberry:~ $ sudo curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

3 - Add User pi to docker User Group


pi@raspberry:~ $ sudo usermod -aG docker pi

4 - Import Docker PGP Key


pi@raspberry:~ $ sudo curl https://download.docker.com/linux/raspbian/gpg

5 - Setting up Docker Repository


pi@raspberry:~ $ sudo nano /etc/apt/sources.list

Append following line

deb https://download.docker.com/linux/raspbian/ stretch stable

Ctrl+X -> Y -> Enter


6 - Apply Patch


pi@raspberry:~ $ sudo apt-get update
pi@raspberry:~ $ sudo apt-get upgrade

7 - Start Docker Service


pi@raspberry:~ $ sudo systemctl start docker.service

8 - Verify Docker Installation


pi@raspberry:~ $ sudo docker info

Remove Docker


pi@raspberry:~ $ sudo apt-get remove --auto-remove docker #Removes docker and dependencies
pi@raspberry:~ $ sudo apt-get purge docker-ce #For newer versions 
pi@raspberry:~ $ sudo dpkg -l | grep docker
pi@raspberry:~ $ sudo sudo dpkg --purge docker-ce
pi@raspberry:~ $ sudo sudo dpkg --purge docker-ce-cli
pi@raspberry:~ $ sudo rm -rf /var/lib/docker #Removes all data