Skip to content

Latest commit

 

History

History
93 lines (76 loc) · 1.77 KB

11-setting-up-docker.md

File metadata and controls

93 lines (76 loc) · 1.77 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:~ $ cd /tmp && \
curl -fsSL get.docker.com -o get-docker.sh && \
chmod +x get-docker.sh && \
sudo ./get-docker.sh

3 - Add User to docker User Group


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

4 - Setting up Docker Repository


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

Append following line

deb https://download.docker.com/linux/debian bullseye stable

Ctrl+X -> Y -> Enter


5 - Apply Patch


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

6 - Start Docker Service


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

7 - 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